l.s.s.f.SoyuzScript(LaunchpadScript) : class documentation

Part of lp.soyuz.scripts.ftpmasterbase View In Hierarchy

Known subclasses: lp.soyuz.scripts.add_missing_builds.AddMissingBuilds, lp.soyuz.scripts.obsolete_distroseries.ObsoleteDistroseries, lp.soyuz.scripts.populate_archive.ArchivePopulator

LaunchpadScript extended for Soyuz related use.

Possible exceptions raised are:

The test harness doesn't enter via main(), it calls mainTask(), so it does not see LaunchpadScriptError.

Each script can extend:

See add_my_options for the default SoyuzScript command-line options.

Method add_my_options Adds SoyuzScript default options.
Method add_transaction_options Add SoyuzScript transaction-related options.
Method add_distro_options Add SoyuzScript distro-related options.
Method add_package_location_options Add SoyuzScript package location-related options.
Method add_archive_options Add SoyuzScript archive-related options.
Method waitForUserConfirmation Blocks the script flow waiting for a user confirmation.
Method setupLocation Setup PackageLocation for context distribution and suite.
Method finishProcedure Script finalization procedure.
Method main LaunchpadScript entry point.
Method mainTask Main task to be performed by the script
Method _getUserConfirmation Use raw_input to collect user feedback.

Inherited from LaunchpadScript:

Method __init__ Construct new 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 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 record_activity Hook to record script activity.
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 add_my_options(self):
Adds SoyuzScript default options.

Any subclass may override this method and call the add_*_options individually to reduce the number of available options as necessary.

def add_transaction_options(self):
Add SoyuzScript transaction-related options.
def add_distro_options(self):
Add SoyuzScript distro-related options.
def add_package_location_options(self):
Add SoyuzScript package location-related options.
def add_archive_options(self):
Add SoyuzScript archive-related options.
def _getUserConfirmation(self, full_question=None, valid_answers=None):
Use raw_input to collect user feedback.

Return True if the user typed the first value of the given 'valid_answers' (defaults to 'yes') or False otherwise.

def waitForUserConfirmation(self):
Blocks the script flow waiting for a user confirmation.

Return True immediately if options.confirm_all was passed or after getting a valid confirmation, False otherwise.

def setupLocation(self):
Setup PackageLocation for context distribution and suite.
def finishProcedure(self):
Script finalization procedure.

'dry-run' command-line option will case the transaction to be immediatelly aborted.

In normal mode it will ask for user confirmation (see waitForUserConfirmation) and will commit the transaction or abort it according to the user answer.

Returns True if the transaction was committed, False otherwise.

def main(self):
LaunchpadScript entry point.

Can only raise LaunchpadScriptFailure - other exceptions are absorbed into that.

def mainTask(self):
Main task to be performed by the script
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.