Merge branch 'ss/improve_logging_using_str' into next
This commit is contained in:
commit
e614838a1f
@ -125,6 +125,9 @@ class Account(CustomConfig.ConfigHelperMixin):
|
|||||||
def getname(self):
|
def getname(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
def getsection(self):
|
def getsection(self):
|
||||||
return 'Account ' + self.getname()
|
return 'Account ' + self.getname()
|
||||||
|
|
||||||
@ -253,7 +256,7 @@ class SyncableAccount(Account):
|
|||||||
thread = InstanceLimitedThread(\
|
thread = InstanceLimitedThread(\
|
||||||
instancename = 'FOLDER_' + self.remoterepos.getname(),
|
instancename = 'FOLDER_' + self.remoterepos.getname(),
|
||||||
target = syncfolder,
|
target = syncfolder,
|
||||||
name = "Folder sync [%s]" % self.name,
|
name = "Folder sync [%s]" % self,
|
||||||
args = (self.name, remoterepos, remotefolder, localrepos,
|
args = (self.name, remoterepos, remotefolder, localrepos,
|
||||||
statusrepos, quick))
|
statusrepos, quick))
|
||||||
thread.setDaemon(1)
|
thread.setDaemon(1)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# Base folder support
|
# Base folder support
|
||||||
# Copyright (C) 2002 John Goerzen
|
# Copyright (C) 2002-2011 John Goerzen & contributors
|
||||||
# <jgoerzen@complete.org>
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -25,7 +24,7 @@ import traceback
|
|||||||
class BaseFolder:
|
class BaseFolder:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ui = getglobalui()
|
self.ui = getglobalui()
|
||||||
|
|
||||||
def getname(self):
|
def getname(self):
|
||||||
"""Returns name"""
|
"""Returns name"""
|
||||||
return self.name
|
return self.name
|
||||||
@ -74,7 +73,7 @@ class BaseFolder:
|
|||||||
return self.getroot() + self.getsep() + self.getname()
|
return self.getroot() + self.getsep() + self.getname()
|
||||||
else:
|
else:
|
||||||
return self.getname()
|
return self.getname()
|
||||||
|
|
||||||
def getfolderbasename(self):
|
def getfolderbasename(self):
|
||||||
foldername = self.getname()
|
foldername = self.getname()
|
||||||
foldername = foldername.replace(self.repository.getsep(), '.')
|
foldername = foldername.replace(self.repository.getsep(), '.')
|
||||||
@ -97,7 +96,7 @@ class BaseFolder:
|
|||||||
def _getuidfilename(self):
|
def _getuidfilename(self):
|
||||||
return os.path.join(self.repository.getuiddir(),
|
return os.path.join(self.repository.getuiddir(),
|
||||||
self.getfolderbasename())
|
self.getfolderbasename())
|
||||||
|
|
||||||
def getsaveduidvalidity(self):
|
def getsaveduidvalidity(self):
|
||||||
if hasattr(self, '_base_saved_uidvalidity'):
|
if hasattr(self, '_base_saved_uidvalidity'):
|
||||||
return self._base_saved_uidvalidity
|
return self._base_saved_uidvalidity
|
||||||
@ -242,7 +241,7 @@ class BaseFolder:
|
|||||||
message = None
|
message = None
|
||||||
flags = self.getmessageflags(uid)
|
flags = self.getmessageflags(uid)
|
||||||
rtime = self.getmessagetime(uid)
|
rtime = self.getmessagetime(uid)
|
||||||
|
|
||||||
if uid > 0 and dstfolder.uidexists(uid):
|
if uid > 0 and dstfolder.uidexists(uid):
|
||||||
# dst has message with that UID already, only update status
|
# dst has message with that UID already, only update status
|
||||||
statusfolder.savemessage(uid, None, flags, rtime)
|
statusfolder.savemessage(uid, None, flags, rtime)
|
||||||
@ -250,7 +249,7 @@ class BaseFolder:
|
|||||||
|
|
||||||
self.ui.copyingmessage(uid, self, [dstfolder])
|
self.ui.copyingmessage(uid, self, [dstfolder])
|
||||||
# If any of the destinations actually stores the message body,
|
# If any of the destinations actually stores the message body,
|
||||||
# load it up.
|
# load it up.
|
||||||
if dstfolder.storesmessages():
|
if dstfolder.storesmessages():
|
||||||
|
|
||||||
message = self.getmessage(uid)
|
message = self.getmessage(uid)
|
||||||
@ -380,7 +379,7 @@ class BaseFolder:
|
|||||||
self.ui.deletingflags(delflaglist[flag], flag, dstfolder)
|
self.ui.deletingflags(delflaglist[flag], flag, dstfolder)
|
||||||
dstfolder.deletemessagesflags(delflaglist[flag], [flag])
|
dstfolder.deletemessagesflags(delflaglist[flag], [flag])
|
||||||
statusfolder.deletemessagesflags(delflaglist[flag], [flag])
|
statusfolder.deletemessagesflags(delflaglist[flag], [flag])
|
||||||
|
|
||||||
def syncmessagesto(self, dstfolder, statusfolder):
|
def syncmessagesto(self, dstfolder, statusfolder):
|
||||||
"""Syncs messages in this folder to the destination dstfolder.
|
"""Syncs messages in this folder to the destination dstfolder.
|
||||||
|
|
||||||
|
@ -72,6 +72,9 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
|
|||||||
def getname(self):
|
def getname(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
def getuiddir(self):
|
def getuiddir(self):
|
||||||
return self.uiddir
|
return self.uiddir
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user