From 73952b8c2c76ae51a31d7746b9db30ae6992f09a Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Fri, 13 Feb 2015 17:43:29 +0100 Subject: [PATCH] offlineimap.conf: say what is the default value for the sep option Some style improvements. Signed-off-by: Nicolas Sebrecht --- offlineimap.conf | 3 ++- offlineimap/folder/LocalStatusSQLite.py | 26 ++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/offlineimap.conf b/offlineimap.conf index cfafb23..3ffc2e6 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -403,8 +403,9 @@ localfolders = ~/Test # folders. It is inserted in-between the components of the tree. If you # want your folders to be nested directories, set it to "/". 'sep' is # ignored for IMAP repositories, as it is queried automatically. +# Otherwise, default value is ".". # -#sep = . +#sep = "." # This option stands in the [Repository LocalExample] section. diff --git a/offlineimap/folder/LocalStatusSQLite.py b/offlineimap/folder/LocalStatusSQLite.py index c66ca44..f54ba99 100644 --- a/offlineimap/folder/LocalStatusSQLite.py +++ b/offlineimap/folder/LocalStatusSQLite.py @@ -33,24 +33,24 @@ class LocalStatusSQLiteFolder(BaseFolder): connection and cursor for all operations. This is a big disadvantage and we might want to investigate if we cannot hold an object open for a thread somehow.""" - #though. According to sqlite docs, you need to commit() before - #the connection is closed or your changes will be lost!""" - #get db connection which autocommits - #connection = sqlite.connect(self.filename, isolation_level=None) - #cursor = connection.cursor() - #return connection, cursor + # Though. According to sqlite docs, you need to commit() before + # the connection is closed or your changes will be lost! + # get db connection which autocommits + # connection = sqlite.connect(self.filename, isolation_level=None) + # cursor = connection.cursor() + # return connection, cursor - #current version of our db format + # Current version of our db format. cur_version = 2 def __init__(self, name, repository): - self.sep = '.' #needs to be set before super.__init__() + self.sep = '.' # Needs to be set before super.__init__() super(LocalStatusSQLiteFolder, self).__init__(name, repository) self.root = repository.root self.filename = os.path.join(self.getroot(), self.getfolderbasename()) self.messagelist = {} - self._newfolder = False # flag if the folder is new + self._newfolder = False # Flag if the folder is new. dirname = os.path.dirname(self.filename) if not os.path.exists(dirname): @@ -59,10 +59,10 @@ class LocalStatusSQLiteFolder(BaseFolder): raise UserWarning("SQLite database path '%s' is not a directory."% dirname) - # dblock protects against concurrent writes in same connection + # dblock protects against concurrent writes in same connection. self._dblock = Lock() - #Try to establish connection, no need for threadsafety in __init__ + # Try to establish connection, no need for threadsafety in __init__. try: self.connection = sqlite.connect(self.filename, check_same_thread=False) except NameError: @@ -71,10 +71,10 @@ class LocalStatusSQLiteFolder(BaseFolder): "with available bindings to '%s'. Is the sqlite3 package " "installed?."% self.filename), None, exc_info()[2] - #Make sure sqlite is in multithreading SERIALIZE mode + # 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. + # 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'")