Back to index

system-config-printer  1.3.9+20120706
Classes | Functions | Variables
monitor Namespace Reference

Classes

class  Monitor
class  SignalWatcher

Functions

def state_reason_is_harmless
def collect_printer_state_reasons

Variables

int CONNECTING_TIMEOUT = 60
int MIN_REFRESH_INTERVAL = 1
tuple m = Monitor()
tuple loop = gobject.MainLoop()

Function Documentation

def monitor.collect_printer_state_reasons (   connection,
  ppdcache 
)

Definition at line 45 of file monitor.py.

00045 
00046 def collect_printer_state_reasons (connection, ppdcache):
00047     result = {}
00048     try:
00049         printers = connection.getPrinters ()
00050     except cups.IPPError:
00051         return result
00052 
00053     for name, printer in printers.iteritems ():
00054         reasons = printer["printer-state-reasons"]
00055         for reason in reasons:
00056             if reason == "none":
00057                 break
00058             if state_reason_is_harmless (reason):
00059                 continue
00060             if not result.has_key (name):
00061                 result[name] = []
00062             result[name].append (StateReason (name, reason, ppdcache))
00063     return result

Definition at line 36 of file monitor.py.

00036 
00037 def state_reason_is_harmless (reason):
00038     if (reason.startswith ("moving-to-paused") or
00039         reason.startswith ("paused") or
00040         reason.startswith ("shutdown") or
00041         reason.startswith ("stopping") or
00042         reason.startswith ("stopped-partly")):
00043         return True
00044     return False


Variable Documentation

Definition at line 33 of file monitor.py.

tuple monitor.loop = gobject.MainLoop()

Definition at line 816 of file monitor.py.

tuple monitor.m = Monitor()

Definition at line 813 of file monitor.py.

Definition at line 34 of file monitor.py.