l.t.s.t.ExportTranslationsToBranch(LaunchpadCronScript) : class documentation

Part of lp.translations.scripts.translations_to_branch View In Hierarchy

Commit translations to translations_branches where requested.
Method add_my_options See LaunchpadScript.
Method main See LaunchpadScript.
Method _checkForObjections Check for reasons why we can't commit to this branch.
Method _makeDirectBranchCommit Create a DirectBranchCommit.
Method _commit Commit changes to branch. Check for race conditions.
Method _isTranslationsCommit Is revision an automatic translations commit?
Method _getRevisionTime Get timestamp of revision.
Method _getLatestTranslationsCommit Get date of last translations commit to branch, if any.
Method _findChangedPOFiles Return an iterator of POFiles changed since changed_since.
Method _exportToBranch Export translations for source into source.translations_branch.
Method _exportToBranches Loop over productseries_iter and export their translations.
Method _sendMail Wrapper for simple_sendmail. Fakeable for easy testing.
Method _handleUnpushedBranch Branch has never been scanned. Notify owner.

Inherited from LaunchpadCronScript:

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 (via LaunchpadCronScript):

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 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):
See LaunchpadScript.
def _checkForObjections(self, source):
Check for reasons why we can't commit to this branch.

Raises ConcurrentUpdateError if there is such a reason.

Parameterssourcethe series being exported to its translations_branch.
def _makeDirectBranchCommit(self, db_branch):
Create a DirectBranchCommit.
Parametersdb_branchA Branch object as defined in Launchpad.
ReturnsA DirectBranchCommit for db_branch.
def _commit(self, source, committer):
Commit changes to branch. Check for race conditions.
def _isTranslationsCommit(self, revision):
Is revision an automatic translations commit?
def _getRevisionTime(self, revision):
Get timestamp of revision.
def _getLatestTranslationsCommit(self, branch):
Get date of last translations commit to branch, if any.
def _findChangedPOFiles(self, source, changed_since):
Return an iterator of POFiles changed since changed_since.
Parameterssourcea ProductSeries.
changed_sincea datetime object.
def _exportToBranch(self, source):
Export translations for source into source.translations_branch.
Parameterssourcea ProductSeries.
def _exportToBranches(self, productseries_iter):
Loop over productseries_iter and export their translations.
def _sendMail(self, sender, recipients, subject, text):
Wrapper for simple_sendmail. Fakeable for easy testing.
def _handleUnpushedBranch(self, productseries):
Branch has never been scanned. Notify owner.

This means that as far as the Launchpad database knows, there is no actual bzr branch behind this IBranch yet.

def main(self):
See LaunchpadScript.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.