]> git.neil.brown.name Git - plato.git/commitdiff
lock: remove some white space and dead comments
authorNeilBrown <neilb@suse.de>
Fri, 13 Dec 2013 07:40:42 +0000 (18:40 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 13 Dec 2013 07:40:42 +0000 (18:40 +1100)
utils/lock.py

index ac456ba9cf0ab1392aef8a8fca8c2978db986deb..c4ab396ed7a03b8b9d69c43c88171f739db5b5dc 100755 (executable)
 #    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