]> git.neil.brown.name Git - plato.git/commitdiff
lock: allow vib pattern to be set by profile
authorNeilBrown <neilb@suse.de>
Fri, 20 Dec 2013 22:59:14 +0000 (09:59 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 20 Dec 2013 23:00:04 +0000 (10:00 +1100)
utils/lock.py

index 4f68d8d1247c344848b4c94ea9a067abce10b7cd..d7e0253d671ed34cee3d58d721a6ce87cf5c0259 100755 (executable)
@@ -119,7 +119,11 @@ def do_alert(event, who):
         except:
             pass
     if 'vib' in p and p['vib']:
-        set_vibrate(200,400,1800)
+        ptn = p['vib'].split()
+        if len(ptn) == 3 and ptn[0].isdigit and ptn[1].isdigit and ptn[2].isdigit:
+            set_vibrate(int(ptn[0]), int(ptn[1]), int(ptn[2]))
+        else:
+            set_vibrate(200,400,1800)
     return n
 
 class SetAlerts: