Rename folder.getsaveduidvalidity(), folder.getuidvalidity()

Modernize names to: folder.get_saveduidvalidity(), folder.get_uidvalidity()

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-01-19 11:50:19 +01:00
parent 9453e1d955
commit 297a618441
3 changed files with 9 additions and 5 deletions

View File

@ -116,8 +116,8 @@ class BaseFolder(object):
function is not threadsafe. So don't attempt to call it from function is not threadsafe. So don't attempt to call it from
concurrent threads.""" concurrent threads."""
if self.getsaveduidvalidity() != None: if self.get_saveduidvalidity() != None:
return self.getsaveduidvalidity() == self.get_uidvalidity() return self.get_saveduidvalidity() == self.get_uidvalidity()
else: else:
self.saveuidvalidity() self.saveuidvalidity()
return 1 return 1
@ -126,7 +126,11 @@ class BaseFolder(object):
return os.path.join(self.repository.getuiddir(), return os.path.join(self.repository.getuiddir(),
self.getfolderbasename()) self.getfolderbasename())
def getsaveduidvalidity(self): def get_saveduidvalidity(self):
"""Return the previously cached UIDVALIDITY value
:returns: UIDVALIDITY as (long) number or None, if None had been
saved yet."""
if hasattr(self, '_base_saved_uidvalidity'): if hasattr(self, '_base_saved_uidvalidity'):
return self._base_saved_uidvalidity return self._base_saved_uidvalidity
uidfilename = self._getuidfilename() uidfilename = self._getuidfilename()

View File

@ -70,7 +70,7 @@ class MachineUI(UIBase):
def validityproblem(s, folder): def validityproblem(s, folder):
s._printData('validityproblem', "%s\n%s\n%s\n%s" % \ s._printData('validityproblem', "%s\n%s\n%s\n%s" % \
(folder.getname(), folder.getrepository().getname(), (folder.getname(), folder.getrepository().getname(),
folder.getsaveduidvalidity(), folder.get_uidvalidity())) folder.get_saveduidvalidity(), folder.get_uidvalidity()))
def connecting(s, hostname, port): def connecting(s, hostname, port):
s._printData('connecting', "%s\n%s" % (hostname, str(port))) s._printData('connecting', "%s\n%s" % (hostname, str(port)))

View File

@ -311,7 +311,7 @@ class UIBase(object):
"(saved %d; got %d); skipping it. Please see FAQ " "(saved %d; got %d); skipping it. Please see FAQ "
"and manual on how to handle this." % \ "and manual on how to handle this." % \
(folder, folder.getrepository(), (folder, folder.getrepository(),
folder.getsaveduidvalidity(), folder.get_uidvalidity())) folder.get_saveduidvalidity(), folder.get_uidvalidity()))
def loadmessagelist(self, repos, folder): def loadmessagelist(self, repos, folder):
self.logger.debug("Loading message list for %s[%s]" % ( self.logger.debug("Loading message list for %s[%s]" % (