aboutsummaryrefslogtreecommitdiff
path: root/ayatanawebmail
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-12-19 19:17:35 +0100
committerRobert Tari <robert@tari.in>2021-12-19 19:17:35 +0100
commit2be507e96007b97d73995936ad50c469a4a8a798 (patch)
tree38d89a81ef4cf6a97af403f32053ee05a96d0141 /ayatanawebmail
parent552c6119e7faba2924b9381ef291f89861f83a28 (diff)
downloadayatana-webmail-2be507e96007b97d73995936ad50c469a4a8a798.tar.gz
ayatana-webmail-2be507e96007b97d73995936ad50c469a4a8a798.tar.bz2
ayatana-webmail-2be507e96007b97d73995936ad50c469a4a8a798.zip
Do not run helper applications unless ayatana-webmail is running
Diffstat (limited to 'ayatanawebmail')
-rwxr-xr-xayatanawebmail/application.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/ayatanawebmail/application.py b/ayatanawebmail/application.py
index 8bb76ea..b6abf38 100755
--- a/ayatanawebmail/application.py
+++ b/ayatanawebmail/application.py
@@ -1081,33 +1081,36 @@ class AyatanaWebmail(object):
logger.info('Checking network...')
if not checkNetwork():
+
return False
- logger.info('Network connection active, connecting...')
+ if (lstConnections):
- for oConnection in lstConnections:
+ logger.info('Network connection active, connecting...')
- oConnection.close()
+ for oConnection in lstConnections:
- try:
+ oConnection.close()
- oConnection.connect()
- oConnection.bConnecting = False
+ try:
- except KeyboardInterrupt:
+ oConnection.connect()
+ oConnection.bConnecting = False
- self.close(0)
+ except KeyboardInterrupt:
- except Exception as oException:
+ self.close(0)
+
+ except Exception as oException:
- logger.error('"{0}:{1}" could not connect: {2}'.format(oConnection.strLogin, oConnection.strFolder, str(oException)))
+ logger.error('"{0}:{1}" could not connect: {2}'.format(oConnection.strLogin, oConnection.strFolder, str(oException)))
- oNotification = Notify.Notification.new(_('Connection error'), '', APPNAME)
- oNotification.set_property('body', _('Unable to connect to account "{accountName}", the application will now exit.').format(accountName=oConnection.strLogin))
- oNotification.set_hint('desktop-entry', GLib.Variant.new_string(APPNAME))
- oNotification.set_timeout(Notify.EXPIRES_NEVER)
- oNotification.show()
- self.close(1)
+ oNotification = Notify.Notification.new(_('Connection error'), '', APPNAME)
+ oNotification.set_property('body', _('Unable to connect to account "{accountName}", the application will now exit.').format(accountName=oConnection.strLogin))
+ oNotification.set_hint('desktop-entry', GLib.Variant.new_string(APPNAME))
+ oNotification.set_timeout(Notify.EXPIRES_NEVER)
+ oNotification.show()
+ self.close(1)
return False