Module Expr Str Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Num Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num If CompareNotEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr Str attr BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str If CompareGtE AttributeLoad NameLoad attr Num body Print Str TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore NameLoad ExceptHandler type NameLoad body Assign NameStore NameLoad If NameLoad body Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareGtE AttributeLoad NameLoad attr Num body Print Str TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore NameLoad ExceptHandler type NameLoad body Assign NameStore NameLoad If UnaryOpNot NameLoad body Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod NameLoad AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return TryExcept body While Num body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad If CompareGt Call AttributeLoad NameLoad attr Str Num body If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Print Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num If CompareGtE AttributeLoad NameLoad attr Num body Print Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list decorator_list
N/A N/A 
    ***
    Modified generic daemon class
    ***

    Author:     http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
                www.boxedice.com

    License:    http://creativecommons.org/licenses/by-sa/3.0/

    Changes:    23rd Jan 2009 (David Mytton <david@boxedice.com>)
                - Replaced hard coded '/dev/null in __init__ with os.devnull
                - Added OS check to conditionally remove code that doesn't work on OS X
                - Added output to console on completion
                - Tidied up formatting
                11th Mar 2009 (David Mytton <david@boxedice.com>)
                - Fixed problem with daemon exiting on Python 2.4 (before SystemExit was part of the Exception base)
                13th Aug 2010 (David Mytton <david@boxedice.com>
                - Fixed unhandled exception if PID file is empty
 N/A atexit N/A os N/A sys N/A time N/A signal Daemon N/A object N/A N/A 
    A generic daemon class.

    Usage: subclass the Daemon class and override the run() method
     __init__ N/A N/A self pidfile stdin stdout stderr home_dir umask verbose N/A N/A os devnull N/A os devnull N/A os devnull . 18 1 N/A N/A N/A self stdin stdin N/A N/A self stdout stdout N/A N/A self stderr stderr N/A N/A self pidfile pidfile N/A N/A self home_dir home_dir N/A N/A self verbose verbose N/A N/A self umask umask N/A N/A self daemon_alive True N/A daemonize N/A N/A self N/A N/A N/A 
        Do the UNIX double-fork magic, see Stevens' "Advanced
        Programming in the UNIX Environment" for details (ISBN 0201563177)
        http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
         N/A N/A N/A pid N/A N/A os fork N/A N/A pid 0 N/A N/A N/A N/A sys exit 0 N/A N/A N/A OSError N/A e N/A N/A N/A N/A N/A sys stderr write N/A fork #1 failed: %d (%s)
 N/A N/A e errno N/A e strerror N/A N/A N/A sys exit 1 N/A N/A N/A os chdir N/A self home_dir N/A N/A N/A os setsid N/A N/A N/A os umask N/A self umask N/A N/A N/A pid N/A N/A os fork N/A N/A pid 0 N/A N/A N/A N/A sys exit 0 N/A N/A N/A OSError N/A e N/A N/A N/A N/A N/A sys stderr write N/A fork #2 failed: %d (%s)
 N/A N/A e errno N/A e strerror N/A N/A N/A sys exit 1 N/A N/A N/A sys platform darwin N/A N/A N/A N/A N/A sys stdout flush N/A N/A N/A N/A sys stderr flush N/A si N/A file N/A self stdin r N/A so N/A file N/A self stdout a+ N/A N/A self stderr N/A N/A se N/A file N/A self stderr a+ 0 N/A N/A N/A os dup2 N/A N/A se fileno N/A N/A N/A sys stderr fileno N/A N/A se N/A sys stderr N/A N/A N/A os dup2 N/A N/A si fileno N/A N/A N/A sys stdin fileno N/A N/A N/A os dup2 N/A N/A so fileno N/A N/A N/A sys stdout fileno sigtermhandler N/A N/A signum frame N/A N/A N/A N/A self daemon_alive False N/A N/A N/A N/A signal signal N/A signal SIGTERM sigtermhandler N/A N/A N/A signal signal N/A signal SIGINT sigtermhandler N/A N/A N/A self verbose 1 N/A N/A Started N/A N/A N/A atexit register N/A self delpid N/A pid N/A str N/A N/A os getpid N/A N/A N/A N/A file N/A self pidfile w+ write N/A %s
 pid N/A delpid N/A N/A self N/A N/A N/A N/A N/A os remove N/A self pidfile N/A start N/A N/A self N/A args kwargs N/A N/A 
        Start the daemon
         N/A N/A N/A self verbose 1 N/A N/A Starting... N/A N/A N/A pf N/A file N/A self pidfile r N/A pid N/A int N/A N/A N/A N/A pf read strip N/A N/A N/A pf close N/A N/A N/A IOError N/A N/A pid None N/A N/A SystemExit N/A N/A pid None N/A pid N/A N/A message pidfile %s already exists. Is it already running?
 N/A N/A N/A N/A sys stderr write N/A message N/A self pidfile N/A N/A N/A sys exit 1 N/A N/A N/A self daemonize N/A N/A N/A self run args kwargs N/A stop N/A N/A self N/A N/A N/A 
        Stop the daemon
         N/A N/A N/A self verbose 1 N/A N/A Stopping... N/A N/A N/A pf N/A file N/A self pidfile r N/A pid N/A int N/A N/A N/A N/A pf read strip N/A N/A N/A pf close N/A N/A N/A IOError N/A N/A pid None N/A N/A ValueError N/A N/A pid None N/A N/A pid N/A N/A message pidfile %s does not exist. Not running?
 N/A N/A N/A N/A sys stderr write N/A message N/A self pidfile N/A N/A N/A N/A os path exists N/A self pidfile N/A N/A N/A N/A os remove N/A self pidfile N/A N/A N/A N/A 1 N/A N/A N/A N/A os kill pid N/A signal SIGTERM N/A N/A N/A time sleep 0.1 N/A N/A N/A OSError N/A err N/A N/A err N/A str err N/A N/A N/A N/A err find No such process 0 N/A N/A N/A N/A N/A os path exists N/A self pidfile N/A N/A N/A N/A os remove N/A self pidfile N/A N/A N/A str err N/A N/A N/A sys exit 1 N/A N/A N/A self verbose 1 N/A N/A Stopped N/A restart N/A N/A self N/A N/A N/A 
        Restart the daemon
         N/A N/A N/A self stop N/A N/A N/A self start N/A run N/A N/A self N/A N/A N/A 
        You should override this method when you subclass Daemon. It will be called after the process has been
        daemonized by start() or restart().
         N/A N/A