Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Private Member Functions | Private Attributes
scp-dbus-service.KillTimer Class Reference

List of all members.

Public Member Functions

def __init__
def add_hold
def remove_hold
def alive

Private Member Functions

def _add_timeout
def _kill

Private Attributes

 _timeout
 _killfunc
 _holds
 _timer

Detailed Description

Definition at line 51 of file scp-dbus-service.py.


Constructor & Destructor Documentation

def scp-dbus-service.KillTimer.__init__ (   self,
  timeout = 30,
  killfunc = None 
)

Definition at line 52 of file scp-dbus-service.py.

00052 
00053     def __init__ (self, timeout=30, killfunc=None):
00054         self._timeout = timeout
00055         self._killfunc = killfunc
00056         self._holds = 0
00057         self._add_timeout ()


Member Function Documentation

def scp-dbus-service.KillTimer._add_timeout (   self) [private]

Definition at line 58 of file scp-dbus-service.py.

00058 
00059     def _add_timeout (self):
00060         self._timer = gobject.timeout_add_seconds (self._timeout, self._kill)

Here is the caller graph for this function:

def scp-dbus-service.KillTimer._kill (   self) [private]

Definition at line 61 of file scp-dbus-service.py.

00061 
00062     def _kill (self):
00063         debugprint ("Timeout (%ds), exiting" % self._timeout)
00064         if self._killfunc:
00065             self._killfunc ()
00066         else:
00067             sys.exit (0)

def scp-dbus-service.KillTimer.add_hold (   self)

Definition at line 68 of file scp-dbus-service.py.

00068 
00069     def add_hold (self):
00070         if self._holds == 0:
00071             debugprint ("Kill timer stopped")
00072             gobject.source_remove (self._timer)
00073 
00074         self._holds += 1

def scp-dbus-service.KillTimer.alive (   self)

Definition at line 82 of file scp-dbus-service.py.

00082 
00083     def alive (self):
00084         if self._holds == 0:
00085             gobject.source_remove (self._timer)
00086             self._add_timeout ()

Here is the call graph for this function:

def scp-dbus-service.KillTimer.remove_hold (   self)

Definition at line 75 of file scp-dbus-service.py.

00075 
00076     def remove_hold (self):
00077         if self._holds > 0:
00078             self._holds -= 1
00079             if self._holds == 0:
00080                 debugprint ("Kill timer started")
00081                 self._add_timeout ()

Here is the call graph for this function:


Member Data Documentation

scp-dbus-service.KillTimer._holds [private]

Definition at line 55 of file scp-dbus-service.py.

scp-dbus-service.KillTimer._killfunc [private]

Definition at line 54 of file scp-dbus-service.py.

scp-dbus-service.KillTimer._timeout [private]

Definition at line 53 of file scp-dbus-service.py.

scp-dbus-service.KillTimer._timer [private]

Definition at line 59 of file scp-dbus-service.py.


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