diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-04-05 14:06:13 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-04-05 14:06:13 +0200 |
commit | 04bb00b4cf339bc4481c8169acaa4126ac94accb (patch) | |
tree | b379b62406929114cf732b1ca88b0324cd693980 /src/__main__.py | |
parent | make sure that `reset` runs after an exception (diff) | |
download | blueshift-04bb00b4cf339bc4481c8169acaa4126ac94accb.tar.gz blueshift-04bb00b4cf339bc4481c8169acaa4126ac94accb.tar.bz2 blueshift-04bb00b4cf339bc4481c8169acaa4126ac94accb.tar.xz |
make the previous commit optional
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/__main__.py')
-rwxr-xr-x | src/__main__.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/__main__.py b/src/__main__.py index b73108b..2b0c9df 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -72,7 +72,7 @@ setproctitle(sys.argv[0]) ## Set global variables -global i_size, o_size, r_curve, g_curve, b_curve, clip_result, reset, panicgate +global i_size, o_size, r_curve, g_curve, b_curve, clip_result, reset, panicgate, reset_on_error global periodically, wait_period, fadein_time, fadeout_time, fadein_steps, fadeout_steps global monitor_controller, running, continuous_run, panic, _globals_, conf_storage, parser global signal_SIGTERM, signal_SIGUSR1, signal_SIGUSR2, DATADIR, LIBDIR, LIBEXECDIR @@ -215,6 +215,12 @@ trans_delta = -1 :int In what direction are with transitioning? ''' +reset_on_error = True # TODO demo and document this +''' +:bool Whether to reset the colour curves if the configuration script + runs into an exception that it did not handle +''' + ## Combine our globals and locals for the ## configuration script to use @@ -524,9 +530,13 @@ def continuous_run(): # before we sleep. If we did not break # would would run into errors. sleep(fadeout_time / fadeout_steps) + + ## Mark that we ant to reset the colour curves + reset_on_error = True finally: - ## Reset - reset() + ## Reset when done, or on error if not stated otherwise + if reset_on_error: + reset() ## Read command line arguments |