From 7714a8590a227d6fee2618db99b99900ea5c1bf2 Mon Sep 17 00:00:00 2001 From: Martinez Date: Wed, 16 Mar 2016 11:47:17 +0100 Subject: [PATCH] --context: ignore some options (like --armed) --- aux.py | 17 +++++++++-------- over-video.py | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/aux.py b/aux.py index 4ad2262..e2a0133 100644 --- a/aux.py +++ b/aux.py @@ -42,7 +42,7 @@ def _serialize(d): else: return str(d) -def update_cfg_context(main): +def update_cfg_context(main, ignore=[]): """ All main.options that are sourced from either the cfg file or defaults get overridden by those in .over-video. Those that are from command line get saved into .over-video. @@ -86,13 +86,14 @@ def update_cfg_context(main): main.print("syncing context (from .over-video)", prefix.start) for option in options.values(): - if option.name in overrides and option.source is not "cmdline": - override = overrides[option.name] - main.print("using §B--§g{:s}§/ = §m{:s}§/".format(option.name, str(override))) - option.value = override - elif option.source is "cmdline": - overrides[option.name] = option.value - main.print("storing §B--§g{:s}§/ = §m{:s}§/".format(option.name, str(option.value))) + if option.name not in ignore: + if option.name in overrides and option.source is not "cmdline": + override = overrides[option.name] + main.print("using §B--§g{:s}§/ = §m{:s}§/".format(option.name, str(override))) + option.value = override + elif option.source is "cmdline": + overrides[option.name] = option.value + main.print("storing §B--§g{:s}§/ = §m{:s}§/".format(option.name, str(option.value))) with open(".over-video", "w") as f: for name, value in overrides.items(): diff --git a/over-video.py b/over-video.py index 063c5e5..4e9592b 100755 --- a/over-video.py +++ b/over-video.py @@ -68,7 +68,7 @@ if __name__ == '__main__': files.container = 'mkv' if main.cfg.context: - update_cfg_context(main) + update_cfg_context(main, ["armed", "probe", "dump-commands"]) if main.cfg.audio in ('copy', 'drop'): audio_words.append('§c%s§/' %(main.cfg.audio))