[cedar-backup-svn] SF.net SVN: cedar-backup:[980] cedar-backup2/trunk
Brought to you by:
pronovic
|
From: <pro...@us...> - 2010-06-30 22:55:16
|
Revision: 980
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=980&view=rev
Author: pronovic
Date: 2010-06-30 22:55:10 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Fix minor warnings exposed by pylint
Modified Paths:
--------------
cedar-backup2/trunk/setup.py
cedar-backup2/trunk/util/__init__.py
cedar-backup2/trunk/util/createtree.py
cedar-backup2/trunk/util/knapsackdemo.py
cedar-backup2/trunk/util/sorttags.py
Modified: cedar-backup2/trunk/setup.py
===================================================================
--- cedar-backup2/trunk/setup.py 2010-06-30 22:54:17 UTC (rev 979)
+++ cedar-backup2/trunk/setup.py 2010-06-30 22:55:10 UTC (rev 980)
@@ -17,6 +17,8 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# pylint: disable-msg=C0111
+
########################################################################
# Imported modules
########################################################################
Modified: cedar-backup2/trunk/util/__init__.py
===================================================================
--- cedar-backup2/trunk/util/__init__.py 2010-06-30 22:54:17 UTC (rev 979)
+++ cedar-backup2/trunk/util/__init__.py 2010-06-30 22:55:10 UTC (rev 980)
@@ -20,7 +20,9 @@
# Package initialization
########################################################################
-# This causes the util directory to be a package.
+"""
+This causes the util directory to be a package.
+"""
__all__ = [ ]
Modified: cedar-backup2/trunk/util/createtree.py
===================================================================
--- cedar-backup2/trunk/util/createtree.py 2010-06-30 22:54:17 UTC (rev 979)
+++ cedar-backup2/trunk/util/createtree.py 2010-06-30 22:55:10 UTC (rev 980)
@@ -99,9 +99,9 @@
import sys
import os
-import string
+import string # pylint: disable-msg=W0402
import random
-from ConfigParser import SafeConfigParser, ParsingError
+from ConfigParser import SafeConfigParser
#######################################################################
@@ -152,11 +152,10 @@
@return: Size of file that was created.
"""
-
- CHARACTER_SET = string.letters + string.digits + "\n"
+ characterSet = string.letters + string.digits + "\n"
filesize = random.randint(config['minsize'], config['maxsize'])
fp = open(filepath, "w")
- fp.write("".join([random.choice(CHARACTER_SET) for i in xrange(1, filesize)]))
+ fp.write("".join([random.choice(characterSet) for i in xrange(1, filesize)]))
fp.write("\n")
fp.close()
return filesize
Modified: cedar-backup2/trunk/util/knapsackdemo.py
===================================================================
--- cedar-backup2/trunk/util/knapsackdemo.py 2010-06-30 22:54:17 UTC (rev 979)
+++ cedar-backup2/trunk/util/knapsackdemo.py 2010-06-30 22:55:10 UTC (rev 980)
@@ -80,6 +80,8 @@
def main():
+ """Main routine."""
+
# Check arguments
if len(sys.argv) != 3:
print "Usage: %s dir capacity" % sys.argv[0]
@@ -138,7 +140,7 @@
' ALT FIT': alternateFit }
# Run each test
- total_elapsed = 0.0
+ totalElapsed = 0.0
for key in tests.keys():
# Run and time the test
@@ -148,20 +150,20 @@
count = len(items)
# Calculate derived values
- count_pct = (float(count)/float(len(files))) * 100.0
- used_pct = (float(used)/(float(capacity)*BYTES_PER_MBYTE)) * 100.0
+ countPercent = (float(count)/float(len(files))) * 100.0
+ usedPercent = (float(used)/(float(capacity)*BYTES_PER_MBYTE)) * 100.0
elapsed = end - start
- total_elapsed += elapsed
+ totalElapsed += elapsed
# Display the results
print "%s: %5d files (%6.2f%%), %6.2f MB (%6.2f%%), elapsed: %8.5f sec" % (
key,
- count, count_pct,
- used/BYTES_PER_MBYTE, used_pct,
+ count, countPercent,
+ used/BYTES_PER_MBYTE, usedPercent,
elapsed)
# And, print the total elapsed time
- print "\nTotal elapsed processing time was about %.3f seconds." % total_elapsed
+ print "\nTotal elapsed processing time was about %.3f seconds." % totalElapsed
########################################################################
Modified: cedar-backup2/trunk/util/sorttags.py
===================================================================
--- cedar-backup2/trunk/util/sorttags.py 2010-06-30 22:54:17 UTC (rev 979)
+++ cedar-backup2/trunk/util/sorttags.py 2010-06-30 22:55:10 UTC (rev 980)
@@ -2,6 +2,8 @@
# Sort the output of 'svn list --verbose' on a tags directory, by version
# The output is assumed to be piped in.
+# pylint: disable-msg=C0111,C0103
+
import sys
import re
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|