summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/__init__.py
diff options
context:
space:
mode:
authorFabian Affolter <fabian@bernewireless.net>2010-06-07 10:55:15 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-06-07 08:42:52 -0500
commitd52c925dedfabc0f8ba0b3a137fcf977749a055e (patch)
treecba4ec4d0da8d5d55b2999cded97a22f6edfe659 /src/lib/Server/Admin/__init__.py
parent673eab34d1aa60b2a159bd8371f4449564fbb8cd (diff)
downloadbcfg2-d52c925dedfabc0f8ba0b3a137fcf977749a055e.tar.gz
bcfg2-d52c925dedfabc0f8ba0b3a137fcf977749a055e.tar.bz2
bcfg2-d52c925dedfabc0f8ba0b3a137fcf977749a055e.zip
Updated files to match PEP 257
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5894 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Admin/__init__.py')
-rw-r--r--src/lib/Server/Admin/__init__.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/Server/Admin/__init__.py b/src/lib/Server/Admin/__init__.py
index 99f52bda4..e46a2e40c 100644
--- a/src/lib/Server/Admin/__init__.py
+++ b/src/lib/Server/Admin/__init__.py
@@ -15,7 +15,7 @@ class ModeOperationError(Exception):
pass
class Mode(object):
- '''Help message has not yet been added for mode'''
+ """Help message has not yet been added for mode."""
__shorthelp__ = 'Shorthelp not defined yet'
__longhelp__ = 'Longhelp not defined yet'
__args__ = []
@@ -42,7 +42,7 @@ class Mode(object):
raise SystemExit(1)
def get_repo_path(self):
- '''return repository path'''
+ """Return repository path"""
return self.cfp.get('server', 'repository')
def load_stats(self, client):
@@ -61,16 +61,18 @@ class Mode(object):
vdelim - vertical delimiter between columns
padding - # of spaces around the longest element in the column
justify - may be left,center,right
+
"""
hdelim = "="
justify = {'left':str.ljust,
'center':str.center,
'right':str.rjust}[justify.lower()]
- '''
- calculate column widths (longest item in each column
+ """
+ Calculate column widths (longest item in each column
plus padding on both sides)
- '''
+
+ """
cols = list(zip(*rows))
colWidths = [max([len(str(item))+2*padding for \
item in col]) for col in cols]
@@ -86,7 +88,7 @@ class Mode(object):
hdr = False
class MetadataCore(Mode):
- '''Base class for admin-modes that handle metadata'''
+ """Base class for admin-modes that handle metadata."""
def __init__(self, configfile, usage, pwhitelist=None, pblacklist=None):
Mode.__init__(self, configfile)
options = {'plugins': Bcfg2.Options.SERVER_PLUGINS,