c.l.s.g.BaseDatabaseGarbageCollector(LaunchpadCronScript) : class documentation

Part of canonical.launchpad.scripts.garbo View In Hierarchy

Known subclasses: canonical.launchpad.scripts.garbo.DailyDatabaseGarbageCollector, canonical.launchpad.scripts.garbo.HourlyDatabaseGarbageCollector

Abstract base class to run a collection of TunableLoops.
Method __init__ Initialize, and sys.exit() if the cronscript is disabled.
Method add_my_options Optionally customize this hook to define your own options.
Method main Define the meat of your script here. Must be defined.

Inherited from LaunchpadCronScript:

Method record_activity Record the successful completion of the script.

Inherited from LaunchpadScript (via LaunchpadCronScript):

Method login Super-convenience method that avoids the import.
Method lockfilename Return lockfilename.
Method setup_lock Create lockfile.
Method lock_or_die Attempt to lock, and sys.exit(1) if the lock's already taken.
Method lock_or_quit Attempt to lock, and sys.exit(0) if the lock's already taken.
Method unlock Release the lock. Do this before going home.
Method run Actually run the script, executing zcml and initZopeless.
Method lock_and_run Call lock_or_die(), and then run() the script.
Method _init_zca Initialize the ZCA, this can be overriden for testing purpose.
Method _init_db Initialize the database transaction.
def __init__(self, test_args=None):
Initialize, and sys.exit() if the cronscript is disabled.

Rather than hand editing crontab files, cronscripts can be enabled and disabled using a config file.

The control file location is specified by config.canonical.cron_control_url.

def add_my_options(self):

Optionally customize this hook to define your own options.

This method should contain only a set of lines that follow the template:

self.parser.add_option("-f", "--foo", dest="foo",
default="foobar-makes-the-world-go-round", help="You are joking, right?")
def main(self):
Define the meat of your script here. Must be defined.

Raise LaunchpadScriptFailure if you encounter an error condition that makes it impossible for you to proceed; sys.exit(1) will be invoked in that situation.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.