Back to index

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

Functions

def debugprint
def get_debugging
def set_debugging
def fatalException
def nonfatalException

Variables

 _debug = False

Function Documentation

def debug.debugprint (   x)

Definition at line 25 of file debug.py.

00025 
00026 def debugprint (x):
00027     if _debug:
00028         try:
00029             sys.stderr.write (x + "\n")
00030             sys.stderr.flush ()
00031         except:
00032             pass

Here is the caller graph for this function:

def debug.fatalException (   exitcode = 1)

Definition at line 40 of file debug.py.

00040 
00041 def fatalException (exitcode=1):
00042     nonfatalException (type="fatal", end="Exiting")
00043     sys.exit (exitcode)

Definition at line 33 of file debug.py.

00033 
00034 def get_debugging ():
00035     return _debug

def debug.nonfatalException (   type = "non-fatal",
  end = "Continuing anyway.." 
)

Definition at line 44 of file debug.py.

00044 
00045 def nonfatalException (type="non-fatal", end="Continuing anyway.."):
00046     d = get_debugging ()
00047     set_debugging (True)
00048     debugprint ("Caught %s exception.  Traceback:" % type)
00049     (type, value, tb) = sys.exc_info ()
00050     extxt = traceback.format_exception_only (type, value)
00051     for line in traceback.format_tb(tb):
00052         debugprint (line.strip ())
00053     debugprint (extxt[0].strip ())
00054     debugprint (end)
00055     set_debugging (d)

Here is the caller graph for this function:

def debug.set_debugging (   d)

Definition at line 36 of file debug.py.

00036 
00037 def set_debugging (d):
00038     global _debug
00039     _debug = d


Variable Documentation

debug._debug = False

Definition at line 24 of file debug.py.