summaryrefslogtreecommitdiffstats
path: root/src/__main__.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-29 20:59:55 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-29 20:59:55 +0100
commit5e74e55dde92df6d05031d36935ec52e3978083b (patch)
treed4930fc1bbc9d06123f398d5f01cc52bb7e6baf1 /src/__main__.py
parentdocument and reduce code (diff)
downloadblueshift-5e74e55dde92df6d05031d36935ec52e3978083b.tar.gz
blueshift-5e74e55dde92df6d05031d36935ec52e3978083b.tar.bz2
blueshift-5e74e55dde92df6d05031d36935ec52e3978083b.tar.xz
document and code reduction
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xsrc/__main__.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 287a142..40777dc 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -26,7 +26,15 @@ from argparser import *
PROGRAM_NAME = 'blueshift'
+'''
+:str The name of the program
+'''
+
PROGRAM_VERSION = '1.15'
+'''
+:str The version of the program
+'''
+
## Set process title
@@ -38,13 +46,16 @@ def setproctitle(title):
'''
import ctypes
try:
+ # Create strng buffer with title
title = title.encode(sys.getdefaultencoding(), 'replace')
title = ctypes.create_string_buffer(title)
if 'linux' in sys.platform:
- libc = ctypes.cdll.LoadLibrary("libc.so.6")
+ # Set process title on Linux
+ libc = ctypes.cdll.LoadLibrary('libc.so.6')
libc.prctl(15, ctypes.byref(title), 0, 0, 0)
elif 'bsd' in sys.platform:
- libc = ctypes.cdll.LoadLibrary("libc.so.7")
+ # Set process title on at least FreeBSD
+ libc = ctypes.cdll.LoadLibrary('libc.so.7')
libc.setproctitle(ctypes.create_string_buffer(b'-%s'), title)
except:
pass
@@ -53,10 +64,10 @@ setproctitle(sys.argv[0])
## Set global variables
-global DATADIR, 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
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
+global signal_SIGTERM, signal_SIGUSR1, signal_SIGUSR2, DATADIR, LIBDIR, LIBEXECDIR
from aux import *
@@ -70,6 +81,7 @@ from backlight import *
from blackbody import *
+
config_file = None
'''
:str The configuration file to load