Part of lp.translations.scripts
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. |
Raises OptionValueError
if the option's value appears invalid.
Parameters | identifier | String identifying an object. If entirely numeric, taken as id. Otherwise, passed to lookup_function. |
lookup_function | Callback 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. | |
Returns | Numeric object id, or None if no identifier is given. |
Parameters | Language code to match. | |
Returns | SQL condition in string form. |
Parameters | conditions | Set of SQL condition clauses to add to. |
expression | Variable or other SQL expression to match on. | |
match_value | If given, the Boolean value to match. If left as None, no condition is added. |
Parameters | logger | Optional logger to write output to. |
submitter | Delete only messages submitted by this person. | |
reviewer | Delete only messages reviewed by this person. | |
reject_license | Delete only messages submitted by persons who have rejected the licensing agreement. | |
ids | Delete only messages with these TranslationMessage ids. | |
potemplate | Delete only messages in this template. | |
language_code | Language code. Depending on not_language ,
either delete messages in this language or spare messages in this
language that would otherwise be deleted. | |
not_language | Whether to spare (True) or delete (False) messages in this language. | |
is_current_ubuntu | Delete only messages with this is_current_ubuntu value. | |
is_current_upstream | Delete only messages with this is_current_upstream value. | |
msgid_singular | Delete only messages with this singular msgid. | |
origin | Delete only messages with this TranslationOrigin code. | |
Returns | Number of messages deleted. |