Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes | Static Public Attributes
applet.RunLoop Class Reference
Collaboration diagram for applet.RunLoop:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def remove_signal_receiver
def run
def __del__
def handle_dbus_signal
def check_for_jobs

Public Attributes

 system_bus
 session_bus
 loop
 timer

Static Public Attributes

string DBUS_PATH = "/com/redhat/PrinterSpooler"
string DBUS_IFACE = "com.redhat.PrinterSpooler"

Detailed Description

Definition at line 316 of file applet.py.


Constructor & Destructor Documentation

def applet.RunLoop.__init__ (   self,
  session_bus,
  system_bus,
  loop 
)

Definition at line 320 of file applet.py.

00320 
00321     def __init__ (self, session_bus, system_bus, loop):
00322         self.system_bus = system_bus
00323         self.session_bus = session_bus
00324         self.loop = loop
00325         self.timer = None
00326         system_bus.add_signal_receiver (self.handle_dbus_signal,
00327                                         path=self.DBUS_PATH,
00328                                         dbus_interface=self.DBUS_IFACE)
00329         self.check_for_jobs ()

def applet.RunLoop.__del__ (   self)

Definition at line 338 of file applet.py.

00338 
00339     def __del__ (self):
00340         self.remove_signal_receiver ()
00341         if self.timer:
00342             gobject.source_remove (self.timer)

Here is the call graph for this function:


Member Function Documentation

def applet.RunLoop.check_for_jobs (   self,
  args 
)

Definition at line 348 of file applet.py.

00348 
00349     def check_for_jobs (self, *args):
00350         debugprint ("checking for jobs")
00351         if any_jobs ():
00352             if self.timer != None:
00353                 gobject.source_remove (self.timer)
00354 
00355             self.remove_signal_receiver ()
00356 
00357             # Start the job applet.
00358             debugprint ("Starting job applet")
00359             try:
00360                 obj = self.session_bus.get_object (PRINTING_BUS, PRINTING_PATH)
00361                 iface = dbus.Interface (obj, PRINTING_IFACE)
00362                 path = iface.JobApplet ()
00363                 debugprint ("Job applet is %s" % path)
00364             except dbus.DBusException, e:
00365                 try:
00366                     print e
00367                 except:
00368                     pass
00369 
00370         # Don't run this timer again.
00371         return False

Here is the call graph for this function:

Here is the caller graph for this function:

def applet.RunLoop.handle_dbus_signal (   self,
  args 
)

Definition at line 343 of file applet.py.

00343 
00344     def handle_dbus_signal (self, *args):
00345         if self.timer:
00346             gobject.source_remove (self.timer)
00347         self.timer = gobject.timeout_add (200, self.check_for_jobs)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 330 of file applet.py.

00330 
00331     def remove_signal_receiver (self):
00332         self.system_bus.remove_signal_receiver (self.handle_dbus_signal,
00333                                                 path=self.DBUS_PATH,
00334                                                 dbus_interface=self.DBUS_IFACE)

Here is the call graph for this function:

Here is the caller graph for this function:

def applet.RunLoop.run (   self)

Definition at line 335 of file applet.py.

00335 
00336     def run (self):
00337         self.loop.run ()


Member Data Documentation

string applet.RunLoop.DBUS_IFACE = "com.redhat.PrinterSpooler" [static]

Definition at line 318 of file applet.py.

string applet.RunLoop.DBUS_PATH = "/com/redhat/PrinterSpooler" [static]

Definition at line 317 of file applet.py.

Definition at line 323 of file applet.py.

Definition at line 322 of file applet.py.

Definition at line 321 of file applet.py.

Definition at line 324 of file applet.py.


The documentation for this class was generated from the following file: