Base class for database scripts.
Handles logging, daemonizing, config, errors.
|
|
|
|
|
get_database(self,
dbname,
autocommit=0,
isolation_level=-1,
cache=None,
max_age=1200)
Load cached database connection. |
source code
|
|
|
|
|
|
|
init_optparse(self,
parser=None)
Initialize a OptionParser() instance that will be used to parse
command line arguments. |
source code
|
|
|
|
|
reset(self)
Something bad happened, reset all connections. |
source code
|
|
|
|
|
run_once(self)
Run users work function, safely. |
source code
|
|
|
|
|
|
|
set_single_loop(self,
do_single_loop)
Changes whether the script will loop or not. |
source code
|
|
|
start(self)
This will launch main processing thread. |
source code
|
|
|
|
|
|
|
stat_increase(self,
key,
increase=1)
Increases a stat value. |
source code
|
|
|
stat_put(self,
key,
value)
Sets a stat value. |
source code
|
|
|
|
|
work(self)
Here should user's processing happen. |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|