summaryrefslogtreecommitdiff
path: root/src/leap/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/util')
-rw-r--r--src/leap/util/checkerthread.py1
-rw-r--r--src/leap/util/files.py18
2 files changed, 18 insertions, 1 deletions
diff --git a/src/leap/util/checkerthread.py b/src/leap/util/checkerthread.py
index 681c33e1..3430a450 100644
--- a/src/leap/util/checkerthread.py
+++ b/src/leap/util/checkerthread.py
@@ -64,7 +64,6 @@ class CheckerThread(QtCore.QThread):
"""
QtCore.QMutexLocker(self._should_quit_lock)
self._should_quit = True
- self.wait()
def start(self):
"""
diff --git a/src/leap/util/files.py b/src/leap/util/files.py
index f7fda39e..8c7a5af3 100644
--- a/src/leap/util/files.py
+++ b/src/leap/util/files.py
@@ -1,6 +1,7 @@
import os
import stat
import logging
+import time
logger = logging.getLogger(__name__)
@@ -25,3 +26,20 @@ def check_and_fix_urw_only(cert):
logger.error('Error while trying to chmod 600 %s' %
cert)
raise
+
+
+def get_mtime(filename):
+ """
+ Returns the modified time or None if the file doesn't exist
+
+ @param filename: path to check
+ @type filename: str
+
+ @rtype: str
+ """
+ try:
+ _mtime = os.stat(filename)[8]
+ mtime = time.strftime("%c GMT", time.gmtime(_mtime))
+ return mtime
+ except OSError:
+ return None