summaryrefslogtreecommitdiffstats
path: root/Locker.py
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-02-02 14:55:11 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-02-02 14:55:11 +0100
commitfdce6479b90dbeef5ca1857b58e6a37ec21978fd (patch)
tree27c86550345ffecebae49cdbb07b6699b9113d13 /Locker.py
parent9981f9f6a2205ed56f16989b590d939d5dac974a (diff)
downloadpylock-fdce6479b90dbeef5ca1857b58e6a37ec21978fd.tar
pylock-fdce6479b90dbeef5ca1857b58e6a37ec21978fd.zip
Added logout function
Diffstat (limited to 'Locker.py')
-rw-r--r--Locker.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Locker.py b/Locker.py
index 2af8f70..04edb13 100644
--- a/Locker.py
+++ b/Locker.py
@@ -50,3 +50,10 @@ class Locker(object):
self.locked = False
GLib.timeout_add_seconds(1, self._checkLock)
+
+ def _canLogout(self):
+ return (self.locked and self.doLogout is not None and self.currentLogoutTimeout <= 0)
+
+ def logout(self):
+ if self._canLogout():
+ self.doLogout()