Implement server diagnostics

This outputs a handy summary of your server configuration and version
strings etc, which is useful for bug reporting.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-06-30 15:18:03 +02:00
parent 6b3f429c81
commit 3885acf87d
4 changed files with 89 additions and 15 deletions

View File

@ -82,6 +82,9 @@ class Account(CustomConfig.ConfigHelperMixin):
def __str__(self):
return self.name
def getaccountmeta(self):
return os.path.join(self.metadatadir, 'Account-' + self.name)
def getsection(self):
return 'Account ' + self.getname()
@ -154,8 +157,16 @@ class Account(CustomConfig.ConfigHelperMixin):
self.quicknum = 0
return 1
return 0
def serverdiagnostics(self):
"""Output diagnostics for all involved repositories"""
remote_repo = Repository(self, 'remote')
local_repo = Repository(self, 'local')
#status_repo = Repository(self, 'status')
self.ui.serverdiagnostics(remote_repo, 'Remote')
self.ui.serverdiagnostics(local_repo, 'Local')
#self.ui.serverdiagnostics(statusrepos, 'Status')
class SyncableAccount(Account):
"""A syncable email account connecting 2 repositories
@ -233,9 +244,6 @@ class SyncableAccount(Account):
if looping and self.sleeper() >= 2:
looping = 0
def getaccountmeta(self):
return os.path.join(self.metadatadir, 'Account-' + self.name)
def sync(self):
"""Synchronize the account once, then return