l.s.s.b.LaunchpadCronScript(LaunchpadScript) : class documentation

Part of lp.services.scripts.base View In Hierarchy

Known subclasses: lp.archivepublisher.scripts.base.PublisherScript, lp.archivepublisher.scripts.generate_contents_files.GenerateContentsFiles, lp.archivepublisher.scripts.generate_ppa_htaccess.HtaccessTokenGenerator, lp.archivepublisher.scripts.publish_ftpmaster.PublishFTPMaster, lp.archiveuploader.scripts.processupload.ProcessUpload, lp.bugs.scripts.bugnotification.SendBugNotifications, lp.bugs.scripts.checkwatches.__init__.CheckWatchesCronScript, lp.bugs.scripts.cveimport.CVEUpdater, lp.code.scripts.revisionkarma.RevisionKarmaAllocator, lp.registry.scripts.standing.UpdatePersonalStanding, lp.scripts.garbo.BaseDatabaseGarbageCollector, lp.services.apachelogparser.script.ParseApacheLogs, lp.services.scripts.tests.cronscript-crash.CrashScript, lp.services.scripts.tests.example-cronscript.Script, lp.soyuz.scripts.expire_archive_files.ArchiveExpirer, lp.soyuz.scripts.ppakeygenerator.PPAKeyGenerator, lp.translations.scripts.import_queue_gardener.ImportQueueGardener, lp.translations.scripts.po_import.TranslationsImport, lp.translations.scripts.translations_to_branch.ExportTranslationsToBranch

Logs successful script runs in the database.
Method __init__ Construct new LaunchpadScript.
Method get_last_activity Return the last activity, if any.
Method record_activity Record the successful completion of the script.

Inherited from LaunchpadScript:

Method handle_options Undocumented
Method name Enable subclasses to override with command-line arguments.
Method dbuser Enable subclasses to override with command-line arguments.
Method main Define the meat of your script here. Must be defined.
Method add_my_options Optionally customize this hook to define your own options.
Method login Super-convenience method that avoids the import.
Method lockfilename Return lockfilename.
Method lockfilepath Undocumented
Method setup_lock Create lockfile.
Method lock_or_die Attempt to lock, and sys.exit(1) 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 overridden for testing purposes.
Method _init_db Initialize the database transaction.
def __init__(self, name=None, dbuser=None, test_args=None, logger=None, ignore_cron_control=False):
Construct new LaunchpadScript.

Name is a short name for this script; it will be used to assemble a lock filename and to identify the logger object.

Use dbuser to specify the user to connect to the database; if not supplied a default will be used.

Specify test_args when you want to override sys.argv. This is useful in test scripts.

ParametersloggerUse this logger, instead of initializing global logging.
def get_last_activity(self):
Return the last activity, if any.
@log_unhandled_exception_and_exit
def record_activity(self, date_started, date_completed):
Record the successful completion of the script.
API Documentation for Launchpad, generated by pydoctor at 2019-04-19 00:00:03.