Closed Bug 1372251 Opened 8 years ago Closed 8 years ago

[compare-locales] Add command-line argument to overwrite configuration env entries

Categories

(Localization Infrastructure and Tools :: compare-locales, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Pike, Assigned: Pike)

References

Details

Attachments

(1 file)

For c-c, we have the path to mozilla-central encoded in the config as an env variable. To pick up source-tree configs, and to digest this for automation, we need to be able to overwrite this, in particular also via the commandline.
Blocks: 1372254
Assignee: nobody → l10n
Comment on attachment 8886536 [details] bug 1372251, add commandline argument to overwrite variables in toml files, https://reviewboard.mozilla.org/r/157350/#review162532 ::: compare_locales/commands.py:141 (Diff revision 1) > + for define in args.D: > + define_tuple = define.split('=', 1) > + if len(define_tuple) == 1: > + # no '=' in define, assume empty string > + define_tuple.append('') > + config_env[define_tuple[0]] = define_tuple[1] This can be written more concisely with `partition`, which splits only once and uses empty strings as fallback: key, _, value = define.partition('=') config_env[key] = value
Attachment #8886536 - Flags: review?(stas) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: