From 5b9cceab49932a0c1d47a07c88ab9af0acf851c7 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 13 Dec 2013 18:40:42 +1100 Subject: [PATCH] lock: remove some white space and dead comments --- utils/lock.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/utils/lock.py b/utils/lock.py index ac456ba..c4ab396 100755 --- a/utils/lock.py +++ b/utils/lock.py @@ -38,14 +38,6 @@ # to /var/run/sound. A separate program plays the sound. # - restoring the display to "dim" if it is "off". # -# -# contains lots of old/dead code -# - vibrator control for GTA02 -# - watches GTA04 accelerometer and locks display when upside-down -# - look for external network connections. The idea was to disable -# suspend if there were any, but it is too easy for them to remain -# after network is disconnected. -# Needs lots of cleaning up. import gobject import gtk @@ -70,7 +62,7 @@ def sysfs_write(file, val): f.close() except: pass - + vib_timer = None def gta02_set_vibrate(on, off, total): global vib_timer @@ -91,7 +83,7 @@ def clear_vibrator(): vib = "/sys/class/leds/neo1973:vibrator" sysfs_write(vib+"/trigger", "none") -vib_han = None +vib_han = None def set_vibrate(on, off, total): global vib_han if vib_han: @@ -182,7 +174,7 @@ class SetAlerts: except: pass set_vibrate(200,400,1800) - + if display.state != 'on': set_dim() suspend.abort_cycle() @@ -259,7 +251,7 @@ class timespec(ctypes.Structure): ] librt = ctypes.CDLL('librt.so.1') -clock_gettime = librt.clock_gettime +clock_gettime = librt.clock_gettime clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)] def get_ticks(): @@ -267,8 +259,6 @@ def get_ticks(): clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) return t.tv_sec + t.tv_nsec / 1e9 - - timeout = None state = "full" dimtime = 15 @@ -287,7 +277,6 @@ def set_timeout(): elif state == "dim": timeout = gobject.timeout_add(10*1000, set_off) - set_ico_file() global susblock, enable_suspend if state == "off" and enable_suspend: @@ -358,7 +347,6 @@ def external_tcp(): return True return False - def wake_all(down_cnt, moment, typ, code, value): global state, dimtime, alert, suspended if typ == 0: @@ -522,7 +510,7 @@ def resumed(): global suspended #print "resumed" suspended = False - + def main(): global display, ico global screen, power, aux, accel -- 2.39.5