[cedar-backup-svn] SF.net SVN: cedar-backup: [891] cedar-backup2/trunk/CedarBackup2
Brought to you by:
pronovic
|
From: <pro...@us...> - 2008-03-20 17:16:48
|
Revision: 891
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=891&view=rev
Author: pronovic
Date: 2008-03-20 10:16:46 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Clean up pychecker warnings
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/util.py
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2008-03-20 17:12:59 UTC (rev 890)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2008-03-20 17:16:46 UTC (rev 891)
@@ -89,7 +89,7 @@
from CedarBackup2.release import AUTHOR, EMAIL, VERSION, DATE, COPYRIGHT
from CedarBackup2.util import RestrictedContentList, DirectedGraph, PathResolverSingleton
from CedarBackup2.util import sortDict, splitCommandLine, executeCommand, getFunctionReference
-from CedarBackup2.util import getUidGid, encodePath
+from CedarBackup2.util import getUidGid, encodePath, Diagnostics
from CedarBackup2.config import Config
from CedarBackup2.peer import RemotePeer
from CedarBackup2.actions.collect import executeCollect
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2008-03-20 17:12:59 UTC (rev 890)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2008-03-20 17:16:46 UTC (rev 891)
@@ -1019,11 +1019,11 @@
values = self.getValues()
keys = values.keys()
keys.sort()
- max = Diagnostics._getMaxLength(keys) + 3 # three extra dots in output
+ tmax = Diagnostics._getMaxLength(keys) + 3 # three extra dots in output
lines = []
for key in keys:
title = key.title()
- title += (max - len(title)) * '.'
+ title += (tmax - len(title)) * '.'
value = values[key]
line = "%s%s: %s" % (prefix, title, value)
lines.append(line)
@@ -1033,11 +1033,11 @@
"""
Get the maximum length from among a list of strings.
"""
- max = 0
+ tmax = 0
for value in values:
- if len(value) > max:
- max = len(value)
- return max
+ if len(value) > tmax:
+ tmax = len(value)
+ return tmax
_getMaxLength = staticmethod(_getMaxLength)
def _getVersion(self):
@@ -1063,20 +1063,22 @@
"""
Property target to get the operating system platform.
"""
- platform = sys.platform
- if platform.startswith("win"):
- WINDOWS_PLATFORMS = [ "Windows 3.1", "Windows 95/98/ME", "Windows NT/2000/XP", "Windows CE", ]
- wininfo = sys.getwindowsversion()
- winversion = "%d.%d.%d" % (wininfo[0], wininfo[1], wininfo[2])
- winplatform = WINDOWS_PLATFORMS[wininfo[3]]
- wintext = wininfo[4] # i.e. "Service Pack 2"
- return "%s (%s %s %s)" % (platform, winplatform, winversion, wintext)
- else:
- uname = os.uname()
- sysname = uname[0] # i.e. Linux
- release = uname[2] # i.e. 2.16.18-2
- machine = uname[4] # i.e. i686
- return "%s (%s %s %s)" % (platform, sysname, release, machine)
+ try:
+ if sys.platform.startswith("win"):
+ WINDOWS_PLATFORMS = [ "Windows 3.1", "Windows 95/98/ME", "Windows NT/2000/XP", "Windows CE", ]
+ wininfo = sys.getwindowsversion()
+ winversion = "%d.%d.%d" % (wininfo[0], wininfo[1], wininfo[2])
+ winplatform = WINDOWS_PLATFORMS[wininfo[3]]
+ wintext = wininfo[4] # i.e. "Service Pack 2"
+ return "%s (%s %s %s)" % (sys.platform, winplatform, winversion, wintext)
+ else:
+ uname = os.uname()
+ sysname = uname[0] # i.e. Linux
+ release = uname[2] # i.e. 2.16.18-2
+ machine = uname[4] # i.e. i686
+ return "%s (%s %s %s)" % (sys.platform, sysname, release, machine)
+ except AttributeError:
+ return sys.platform
def _getLocale(self):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|