accounts: minor code refactoring

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-11-20 20:22:37 +01:00
parent cf0a559394
commit 54bbe79930

View File

@ -33,7 +33,7 @@ FOLDER_NAMESPACE = 'LIMITED_FOLDER_'
try: try:
import fcntl import fcntl
except: except:
pass # ok if this fails, we can do without pass # Ok if this fails, we can do without.
# FIXME: spaghetti code alert! # FIXME: spaghetti code alert!
def getaccountlist(customconfig): def getaccountlist(customconfig):
@ -77,6 +77,9 @@ class Account(CustomConfig.ConfigHelperMixin):
self.refreshperiod = 0.0 self.refreshperiod = 0.0
if self.refreshperiod == 0.0: if self.refreshperiod == 0.0:
self.refreshperiod = None self.refreshperiod = None
self.remoterepos = None
self.localrepos = None
self.statusrepos = None
def getlocaleval(self): def getlocaleval(self):
return self.localeval return self.localeval
@ -287,7 +290,7 @@ class SyncableAccount(Account):
self.ui.error(e, exc_info()[2], msg= self.ui.error(e, exc_info()[2], msg=
"While attempting to sync account '%s'"% self) "While attempting to sync account '%s'"% self)
else: else:
# after success sync, reset the looping counter to 3 # After success sync, reset the looping counter to 3.
if self.refreshperiod: if self.refreshperiod:
looping = 3 looping = 3
finally: finally: