~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

Viewing changes to Dbus/interfaces/bash/CDBashApplet.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2011-04-20 20:46:51 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110420204651-ftnpzesj6uc7qeul
Tags: 2.3.0~1-0ubuntu1
* New Upstream Version (LP: #723995)
* Upstream short ChangeLog (since 2.3.0~0rc1):
 - Updated translations
 - Updated the integration of the new versions of kwin and compiz
    (Switcher, ShowDesktop, etc.)
 - Removed a lot of useless g_print
 - Updated a few plug-ins to fit with the new version of the API (gldit)
 - Fixed a few bugs
 - Updated MeMenu, MessagingMenu and Status-Notifier to works
    with the latest version of dbusmenu, etc.
* Switch to dpkg-source 3.0 (quilt) format
* debian/cairo-dock-plug-ins.install:
 - Added new files (interfaces for python, ruby, vala and mono)
* debian/control:
 - Added new dependences for new applets (sensors and zeitgeist)
    and new interfaces (python, valac, ruby and mono)
 - Updated the version of cairo-dock build-dependences
* debian/rules:
 - Added a new CMake flag to install python interface in debian/tmp
* Updated debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
# This is a part of the external applets for Cairo-Dock
 
4
# Copyright : (C) 2010-2011 by Nochka85, Fabounet and Matttbe
 
5
# E-mail : fabounet@glx-dock.org
 
6
#
 
7
# This program is free software; you can redistribute it and/or
 
8
# modify it under the terms of the GNU General Public License
 
9
# as published by the Free Software Foundation; either version 2
 
10
# of the License, or (at your option) any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
15
# GNU General Public License for more details.
 
16
# http://www.gnu.org/licenses/licenses.html#GPL
 
17
 
 
18
####################
 
19
### dependancies ###
 
20
####################
 
21
import os.path
 
22
from CDApplet import CDApplet
 
23
 
 
24
####################
 
25
### Applet class ###
 
26
####################
 
27
class CDBashApplet(CDApplet):
 
28
        def __init__(self):
 
29
                # call high-level init
 
30
                self.app_folder = os.path.abspath(".")
 
31
                CDApplet.__init__(self)
 
32
        
 
33
        ##### private methods #####
 
34
        
 
35
        def call(self,action):
 
36
                os.popen("cd " + self.app_folder + " && ./" + self.cAppletName + ".sh " + self.cAppletName + " " + self.cBusPath + " " + self.cConfFile + " " + self.cParentAppName + " " + action).read().rstrip()
 
37
        
 
38
        ##### applet definition #####
 
39
        
 
40
        def get_config(self,keyfile):
 
41
                self.call("get_config")
 
42
        
 
43
        def end(self):
 
44
                self.call("end")
 
45
        
 
46
        def begin(self):
 
47
                self.call("begin")
 
48
        
 
49
        def reload(self):
 
50
                self.call("reload")
 
51
        
 
52
        ##### callbacks #####
 
53
        
 
54
        def on_click(self,iState):
 
55
                self.call("on_click "+str(iState))
 
56
        
 
57
        def on_middle_click(self):
 
58
                self.call("on_middle_click")
 
59
                
 
60
        def on_build_menu(self):
 
61
                self.call("on_build_menu")
 
62
                
 
63
        def on_menu_select(self,iNumEntry):
 
64
                self.call("on_menu_select "+str(iNumEntry))
 
65
        
 
66
        def on_scroll(self,bScrollUp):
 
67
                self.call("on_scroll "+str(bScrollUp))
 
68
        
 
69
        def on_drop_data(self,cReceivedData):
 
70
                self.call("on_drop_data '"+cReceivedData+"'")
 
71
        
 
72
        def on_answer_dialog(self, button, answer):
 
73
                self.call("on_answer_dialog "+str(button)+" '"+str(answer)+"'")
 
74
        
 
75
        def on_shortkey(self,key):
 
76
                self.call("on_shortkey '"+key+"'")
 
77
        
 
78
        def on_change_focus(self,bIsActive):
 
79
                self.call("on_change_focus '"+str(bIsActive)+"'")
 
80
        
 
81
        def on_click_sub_icon(self, iState, cIconID):
 
82
                self.call("on_click_sub_icon '"+str(iState)+"' '"+cIconID+"'")
 
83