summaryrefslogtreecommitdiffstats
path: root/Locker.py
diff options
context:
space:
mode:
Diffstat (limited to 'Locker.py')
-rw-r--r--Locker.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Locker.py b/Locker.py
index 04edb13..d396b94 100644
--- a/Locker.py
+++ b/Locker.py
@@ -4,7 +4,7 @@ import Idle
class Locker(object):
- def __init__(self, lockTimeout, doLock, doUnlock, logoutTimeout = 0, doLogout = None, updateLogoutTimeout = None):
+ def __init__(self, lockTimeout, doLock, doUnlock, logoutTimeout = None, doLogout = None, updateLogoutTimeout = None):
self.locked = False
self.lockTimeout = lockTimeout
self.logoutTimeout = logoutTimeout
@@ -13,7 +13,10 @@ class Locker(object):
self.doLogout = doLogout
self.updateLogoutTimeout = updateLogoutTimeout
- GLib.timeout_add_seconds(1, self._checkLock)
+ if self.lockTimeout > 0:
+ GLib.timeout_add_seconds(1, self._checkLock)
+ else:
+ GLib.idle_add(self.lock)
def _checkLock(self):
if self.locked: