summaryrefslogtreecommitdiffstats
path: root/src/__main__.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-25 08:09:53 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-25 08:12:13 +0100
commit7cd2c283f5231324ff63db367073207b2fe8c04b (patch)
tree7a9aa48be2f815c841fc77a8c6c181c3e50966f8 /src/__main__.py
parenttypo (diff)
downloadblueshift-7cd2c283f5231324ff63db367073207b2fe8c04b.tar.gz
blueshift-7cd2c283f5231324ff63db367073207b2fe8c04b.tar.bz2
blueshift-7cd2c283f5231324ff63db367073207b2fe8c04b.tar.xz
add uses_adhoc_settings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/__main__.py')
-rwxr-xr-xsrc/__main__.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/__main__.py b/src/__main__.py
index f432a23..d7827cd 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -31,7 +31,7 @@ PROGRAM_VERSION = '1.7'
## Set global variables
global DATADIR, i_size, o_size, r_curve, g_curve, b_curve, clip_result, reset, panicgate
global periodically, wait_period, fadein_time, fadeout_time, fadein_steps, fadeout_steps
-global monitor_controller, running, continuous_run, panic, _globals_, conf_storage
+global monitor_controller, running, continuous_run, panic, _globals_, conf_storage, parser
global signal_SIGTERM, signal_SIGUSR1, signal_SIGUSR2
@@ -125,6 +125,11 @@ panic = False
:bool `True` if the program has received two terminate signals
'''
+uses_adhoc_opts = False
+'''
+:bool `True` if the configuration screens parses the ad-hoc settings
+'''
+
conf_opts = None
'''
:list<str> This list will never be `None` and it will always have at least
@@ -356,11 +361,6 @@ output = parser.opts['--output']
if output is None:
output = []
-if config_file is not None:
- if any([doreset, location, gammas, rgb_brightnesses, cie_brightnesses, temperatures, output]):
- print('--configurations can only be combined with --panicgate')
- sys.exit(1)
-
a = lambda opt : 0 if parser.opts[opt] is None else len(parser.opts[opt])
for opt in ('--configurations', '--panicgate', '--reset', '--location'):
if a(opt) > 1:
@@ -474,6 +474,11 @@ else:
print('No configuration file found')
sys.exit(1)
+ # Warn about ad-hoc settings
+ if not uses_adhoc_opts:
+ if any([doreset, location, gammas, rgb_brightnesses, cie_brightnesses, temperatures, output]):
+ print('%s: warning: --configurations can only be combined with --panicgate' % sys.argv[0])
+ parser = None
## Run periodically if configured to
if periodically is not None: