aboutsummaryrefslogtreecommitdiff
path: root/ayatanawebmail/idler.py
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-07-09 23:04:10 +0200
committerRobert Tari <robert@tari.in>2022-07-09 23:04:10 +0200
commit51c7b29c2f2ae154cd85b6f4109ada7b04687ce7 (patch)
tree6502d7b53e23131ea2a9a5a0f427033972dc35bf /ayatanawebmail/idler.py
parent4dea8e0e09c75b90a14914cd273bdbd0da24b818 (diff)
downloadayatana-webmail-51c7b29c2f2ae154cd85b6f4109ada7b04687ce7.tar.gz
ayatana-webmail-51c7b29c2f2ae154cd85b6f4109ada7b04687ce7.tar.bz2
ayatana-webmail-51c7b29c2f2ae154cd85b6f4109ada7b04687ce7.zip
Do not use implicit debugging
Diffstat (limited to 'ayatanawebmail/idler.py')
-rwxr-xr-xayatanawebmail/idler.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/ayatanawebmail/idler.py b/ayatanawebmail/idler.py
index b6b63b4..33b4313 100755
--- a/ayatanawebmail/idler.py
+++ b/ayatanawebmail/idler.py
@@ -6,7 +6,7 @@ from threading import *
class Idler(object):
- def __init__(self, oConnection, fnCallback, oLogger):
+ def __init__(self, oConnection, fnCallback, oLogger, sDebug):
self.oThread = Thread(target=self.idle)
self.oConnection = oConnection
@@ -15,6 +15,7 @@ class Idler(object):
self.bNeedSync = False
self.oLogger = oLogger
self.bAborted = False
+ self.sDebug = sDebug
def start(self):
@@ -48,7 +49,10 @@ class Idler(object):
if (lstArgs[2] != None) and (lstArgs[2][0] is self.oConnection.oImap.abort):
- self.oLogger.info('"{0}:{1}" has been closed by the server.'.format(self.oConnection.strLogin, self.oConnection.strFolder))
+ if self.sDebug == 'info':
+
+ self.oLogger.info('"{0}:{1}" has been closed by the server.'.format(self.oConnection.strLogin, self.oConnection.strFolder))
+
self.bAborted = True
else:
@@ -61,7 +65,10 @@ class Idler(object):
while not self.oConnection.isOpen():
- self.oLogger.info('"{0}:{1}" IDLE is waiting for a connection.'.format(self.oConnection.strLogin, self.oConnection.strFolder))
+ if self.sDebug == 'info':
+
+ self.oLogger.info('"{0}:{1}" IDLE is waiting for a connection.'.format(self.oConnection.strLogin, self.oConnection.strFolder))
+
time.sleep(10)
self.oConnection.oImap.idle(callback=callback, timeout=600)