Skip to content

Commit

Permalink
minor: fix indentation
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Sebrecht <[email protected]>
  • Loading branch information
nicolas33 committed Jan 18, 2015
1 parent d0cb967 commit cb6790b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions offlineimap/folder/LocalStatusSQLite.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def __init__(self, name, repository):
if not os.path.exists(dirname):
os.makedirs(dirname)
if not os.path.isdir(dirname):
raise UserWarning("SQLite database path '%s' is not a directory." % dirname)
raise UserWarning("SQLite database path '%s' is not a directory."%
dirname)

# dblock protects against concurrent writes in same connection
self._dblock = Lock()
Expand All @@ -67,14 +68,15 @@ def __init__(self, name, repository):
except NameError:
# sqlite import had failed
raise UserWarning('SQLite backend chosen, but no sqlite python '
'bindings available. Please install.'), None, exc_info()[2]
'bindings available. Please install.'), None, exc_info()[2]

#Make sure sqlite is in multithreading SERIALIZE mode
assert sqlite.threadsafety == 1, 'Your sqlite is not multithreading safe.'

#Test if db version is current enough and if db is readable.
try:
cursor = self.connection.execute("SELECT value from metadata WHERE key='db_version'")
cursor = self.connection.execute(
"SELECT value from metadata WHERE key='db_version'")
except sqlite.DatabaseError:
#db file missing or corrupt, recreate it.
self.__create_db()
Expand Down
10 changes: 5 additions & 5 deletions offlineimap/repository/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def __new__(cls, account, reqtype):
name = account.getconf('remoterepository')
# We don't support Maildirs on the remote side.
typemap = {'IMAP': IMAPRepository,
'Gmail': GmailRepository}
'Gmail': GmailRepository}

elif reqtype == 'local':
name = account.getconf('localrepository')
typemap = {'IMAP': MappedIMAPRepository,
'Maildir': MaildirRepository,
'GmailMaildir': GmailMaildirRepository}
'Maildir': MaildirRepository,
'GmailMaildir': GmailMaildirRepository}

elif reqtype == 'status':
# create and return a LocalStatusRepository
Expand All @@ -69,15 +69,15 @@ def __new__(cls, account, reqtype):
errstr = ("Could not find section '%s' in configuration. Required "
"for account '%s'." % ('Repository %s' % name, account))
raise OfflineImapError(errstr, OfflineImapError.ERROR.REPO), \
None, exc_info()[2]
None, exc_info()[2]

try:
repo = typemap[repostype]
except KeyError:
errstr = "'%s' repository not supported for '%s' repositories." \
% (repostype, reqtype)
raise OfflineImapError(errstr, OfflineImapError.ERROR.REPO), \
None, exc_info()[2]
None, exc_info()[2]

return repo(name, account)

Expand Down
2 changes: 1 addition & 1 deletion offlineimap/ui/UIBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def sleep(self, sleepsecs, account):
abortsleep = False
while sleepsecs > 0 and not abortsleep:
if account.get_abort_event():
abortsleep = True
abortsleep = True
else:
abortsleep = self.sleeping(10, sleepsecs)
sleepsecs -= 10
Expand Down

0 comments on commit cb6790b

Please sign in to comment.