add the repository name when connecting
Otherwise, it might be impossible to know which account is connecting when more than one is syncing. Code style. Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
9aa5afa951
commit
203c28f21f
@ -342,7 +342,8 @@ class SyncableAccount(Account):
|
|||||||
# Iterate through all folders on the remote repo and sync.
|
# Iterate through all folders on the remote repo and sync.
|
||||||
for remotefolder in remoterepos.getfolders():
|
for remotefolder in remoterepos.getfolders():
|
||||||
# Check for CTRL-C or SIGTERM.
|
# Check for CTRL-C or SIGTERM.
|
||||||
if Account.abort_NOW_signal.is_set(): break
|
if Account.abort_NOW_signal.is_set():
|
||||||
|
break
|
||||||
|
|
||||||
if not remotefolder.sync_this:
|
if not remotefolder.sync_this:
|
||||||
self.ui.debug('', "Not syncing filtered folder '%s'"
|
self.ui.debug('', "Not syncing filtered folder '%s'"
|
||||||
|
@ -484,7 +484,8 @@ class IMAPServer(object):
|
|||||||
while success is not True:
|
while success is not True:
|
||||||
# Generate a new connection.
|
# Generate a new connection.
|
||||||
if self.tunnel:
|
if self.tunnel:
|
||||||
self.ui.connecting('tunnel', self.tunnel)
|
self.ui.connecting(
|
||||||
|
self.repos.getname(), 'tunnel', self.tunnel)
|
||||||
imapobj = imaplibutil.IMAP4_Tunnel(
|
imapobj = imaplibutil.IMAP4_Tunnel(
|
||||||
self.tunnel,
|
self.tunnel,
|
||||||
timeout=socket.getdefaulttimeout(),
|
timeout=socket.getdefaulttimeout(),
|
||||||
@ -492,7 +493,8 @@ class IMAPServer(object):
|
|||||||
)
|
)
|
||||||
success = True
|
success = True
|
||||||
elif self.usessl:
|
elif self.usessl:
|
||||||
self.ui.connecting(self.hostname, self.port)
|
self.ui.connecting(
|
||||||
|
self.repos.getname(), self.hostname, self.port)
|
||||||
imapobj = imaplibutil.WrappedIMAP4_SSL(
|
imapobj = imaplibutil.WrappedIMAP4_SSL(
|
||||||
host=self.hostname,
|
host=self.hostname,
|
||||||
port=self.port,
|
port=self.port,
|
||||||
@ -508,7 +510,8 @@ class IMAPServer(object):
|
|||||||
af=self.af,
|
af=self.af,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.ui.connecting(self.hostname, self.port)
|
self.ui.connecting(
|
||||||
|
self.repos.getname(), self.hostname, self.port)
|
||||||
imapobj = imaplibutil.WrappedIMAP4(
|
imapobj = imaplibutil.WrappedIMAP4(
|
||||||
self.hostname, self.port,
|
self.hostname, self.port,
|
||||||
timeout=socket.getdefaulttimeout(),
|
timeout=socket.getdefaulttimeout(),
|
||||||
|
@ -25,10 +25,11 @@ from threading import currentThread
|
|||||||
import offlineimap
|
import offlineimap
|
||||||
from offlineimap.ui.UIBase import UIBase
|
from offlineimap.ui.UIBase import UIBase
|
||||||
|
|
||||||
protocol = '7.1.0'
|
protocol = '7.2.0'
|
||||||
|
|
||||||
class MachineLogFormatter(logging.Formatter):
|
class MachineLogFormatter(logging.Formatter):
|
||||||
"""urlencodes any outputted line, to avoid multi-line output"""
|
"""urlencodes any outputted line, to avoid multi-line output"""
|
||||||
|
|
||||||
def format(s, record):
|
def format(s, record):
|
||||||
# Mapping of log levels to historic tag names
|
# Mapping of log levels to historic tag names
|
||||||
severity_map = {
|
severity_map = {
|
||||||
@ -101,8 +102,9 @@ class MachineUI(UIBase):
|
|||||||
(folder.getname(), folder.getrepository().getname(),
|
(folder.getname(), folder.getrepository().getname(),
|
||||||
folder.get_saveduidvalidity(), folder.get_uidvalidity()))
|
folder.get_saveduidvalidity(), folder.get_uidvalidity()))
|
||||||
|
|
||||||
def connecting(s, hostname, port):
|
def connecting(s, reposname, hostname, port):
|
||||||
s._printData(s.logger.info, 'connecting', "%s\n%s"% (hostname, str(port)))
|
s._printData(s.logger.info, 'connecting', "%s\n%s\nMs"% (hostname,
|
||||||
|
str(port), reposname))
|
||||||
|
|
||||||
def syncfolders(s, srcrepos, destrepos):
|
def syncfolders(s, srcrepos, destrepos):
|
||||||
s._printData(s.logger.info, 'syncfolders', "%s\n%s"% (s.getnicename(srcrepos),
|
s._printData(s.logger.info, 'syncfolders', "%s\n%s"% (s.getnicename(srcrepos),
|
||||||
|
@ -19,9 +19,11 @@ import logging
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
|
|
||||||
from offlineimap import banner
|
from offlineimap import banner
|
||||||
from offlineimap.ui.UIBase import UIBase
|
from offlineimap.ui.UIBase import UIBase
|
||||||
|
|
||||||
|
|
||||||
class TTYFormatter(logging.Formatter):
|
class TTYFormatter(logging.Formatter):
|
||||||
"""Specific Formatter that adds thread information to the log output."""
|
"""Specific Formatter that adds thread information to the log output."""
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ class UIBase(object):
|
|||||||
create the application window here."""
|
create the application window here."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def connecting(self, hostname, port):
|
def connecting(self, reposname, hostname, port):
|
||||||
"""Log 'Establishing connection to'."""
|
"""Log 'Establishing connection to'."""
|
||||||
|
|
||||||
if not self.logger.isEnabledFor(logging.INFO): return
|
if not self.logger.isEnabledFor(logging.INFO): return
|
||||||
@ -320,7 +320,8 @@ class UIBase(object):
|
|||||||
port = "%s"% port if port else ''
|
port = "%s"% port if port else ''
|
||||||
if hostname:
|
if hostname:
|
||||||
displaystr = ' to %s:%s' % (hostname, port)
|
displaystr = ' to %s:%s' % (hostname, port)
|
||||||
self.logger.info("Establishing connection%s" % displaystr)
|
self.logger.info("Establishing connection%s (%s)"%
|
||||||
|
(displaystr, reposname))
|
||||||
|
|
||||||
def acct(self, account):
|
def acct(self, account):
|
||||||
"""Output that we start syncing an account (and start counting)."""
|
"""Output that we start syncing an account (and start counting)."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user