l.t.s.remove_translations : module documentation

Part of lp.translations.scripts

Remove specific translation messages from the database.
Function process_bool_option Validation and conversion for Boolean argument.
Function get_id Look up id of object identified by a string.
Function get_person_id get_id helper. Look up person by name.
Function get_origin get_id helper. Look up RosettaTranslationOrigin by name.
Function process_origin_option Validation and conversion for RosettaTranslationsOrigin.
Function process_person_option Validation and conversion for Person.
Function process_options Process options that need special processing.
Function is_nonempty_list Is list_option a non-empty a nonempty list of option values?
Function is_nonempty_string Is string_option a non-empty option value?
Function compose_language_match Compose SQL condition for matching a language in the deletion query.
Function add_bool_match Add match for tri-state Boolean to SQL conditions.
Class RemoveTranslations Remove specific `TranslationMessage`s from the database.
Function warn_about_deleting_current_messages Undocumented
Function remove_translations Remove specified translation messages.
def process_bool_option(value):
Validation and conversion for Boolean argument.
def get_id(identifier, lookup_function=None):
Look up id of object identified by a string.

Raises OptionValueError if the option's value appears invalid.

ParametersidentifierString identifying an object. If entirely numeric, taken as id. Otherwise, passed to lookup_function.
lookup_functionCallback that will take identifier as its argument and return a numeric object id. If no object has the given identifier, may raise a LookUpError or return None.
ReturnsNumeric object id, or None if no identifier is given.
def get_person_id(name):
get_id helper. Look up person by name.
def get_origin(name):
get_id helper. Look up RosettaTranslationOrigin by name.
def process_origin_option(value):
Validation and conversion for RosettaTranslationsOrigin.
def process_person_option(value):
Validation and conversion for Person.
def process_options(options):
Process options that need special processing.
def is_nonempty_list(list_option):
Is list_option a non-empty a nonempty list of option values?
def is_nonempty_string(string_option):
Is string_option a non-empty option value?
def compose_language_match(language_code):
Compose SQL condition for matching a language in the deletion query.
ParametersLanguage code to match.
ReturnsSQL condition in string form.
def add_bool_match(conditions, expression, match_value):
Add match for tri-state Boolean to SQL conditions.
ParametersconditionsSet of SQL condition clauses to add to.
expressionVariable or other SQL expression to match on.
match_valueIf given, the Boolean value to match. If left as None, no condition is added.
def warn_about_deleting_current_messages(cur, from_text, where_text, logger):
Undocumented
def remove_translations(logger=None, submitter=None, reviewer=None, reject_license=False, ids=None, potemplate=None, language_code=None, not_language=False, is_current_ubuntu=None, is_current_upstream=None, msgid_singular=None, origin=None):
Remove specified translation messages.
ParametersloggerOptional logger to write output to.
submitterDelete only messages submitted by this person.
reviewerDelete only messages reviewed by this person.
reject_licenseDelete only messages submitted by persons who have rejected the licensing agreement.
idsDelete only messages with these TranslationMessage ids.
potemplateDelete only messages in this template.
language_codeLanguage code. Depending on not_language, either delete messages in this language or spare messages in this language that would otherwise be deleted.
not_languageWhether to spare (True) or delete (False) messages in this language.
is_current_ubuntuDelete only messages with this is_current_ubuntu value.
is_current_upstreamDelete only messages with this is_current_upstream value.
msgid_singularDelete only messages with this singular msgid.
originDelete only messages with this TranslationOrigin code.
ReturnsNumber of messages deleted.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.