Thread: [cedar-backup-svn] SF.net SVN: cedar-backup:[980] cedar-backup2/trunk (Page 2)
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.
|
|
From: <pro...@us...> - 2010-06-30 22:56:25
|
Revision: 981
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=981&view=rev
Author: pronovic
Date: 2010-06-30 22:56:19 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Configure pylint
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
Added Paths:
-----------
cedar-backup2/trunk/pylintrc
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-06-30 22:55:10 UTC (rev 980)
+++ cedar-backup2/trunk/Changelog 2010-06-30 22:56:19 UTC (rev 981)
@@ -1,6 +1,7 @@
Version 2.19.7 unreleased
- * Fix minor Pychecker warnings.
+ * Configure pylint and execute it against the entire codebase.
+ * Fix a variety of minor warnings and suggestions from pylint.
Version 2.19.6 22 May 2010
Added: cedar-backup2/trunk/pylintrc
===================================================================
--- cedar-backup2/trunk/pylintrc (rev 0)
+++ cedar-backup2/trunk/pylintrc 2010-06-30 22:56:19 UTC (rev 981)
@@ -0,0 +1,312 @@
+# lint Python modules using external checkers.
+#
+# This is the main checker controling the other ones and the reports
+# generation. It is itself both a raw checker and an astng checker in order
+# to:
+# * handle message activation / deactivation at the module level
+# * handle some basic but necessary stats'data (number of classes, methods...)
+#
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add <file or directory> to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=.svn
+ignore=.hg
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+disable-msg=I0011,W0702,W0703,W0704,C0302,C0321,R0902,R0911,R0912,R0913,R0914,R0915
+
+
+[REPORTS]
+
+# set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=yes
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells wether to display a full report or only the messages
+reports=no
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note).You have access to the variables errors warning, statement which
+# respectivly contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branchs, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__
+
+# Regular expression which should only match correct module names
+module-rgx=((CedarBackup2)|([a-z][a-z0-9]*))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][A-Za-z0-9]{1,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=((__[a-z]*__$)|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct argument names
+argument-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct variable names
+variable-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=logger,outputLogger,result
+
+# Bad variable names which should always be refused, separated by a comma
+#bad-names=foo,bar,baz,toto,tutu,tata
+bad-names=
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells wether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamicaly set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, consider the acquired-members option to ignore
+# access to some undefined attributes.
+zope=no
+
+# List of members which are usually get through zope's acquisition mecanism and
+# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
+acquired-members=
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assigment
+#
+[VARIABLES]
+
+# Tells wether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=6
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=0
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existant members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+# 50 lines of similarity basically turns this off; I don't care about it
+min-similarity-lines=50
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+# Technically, we like to use 132 characters, but there's a little leeway
+max-line-length=136
+
+# Maximum number of lines in a module
+max-module-lines=2000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
+indent-string=' '
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-06-30 23:03:23
|
Revision: 982
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=982&view=rev
Author: pronovic
Date: 2010-06-30 23:03:17 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Move unit tests into testcase folder to avoid test.py naming conflict
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/testcase/actionsutiltests.py
cedar-backup2/trunk/testcase/capacitytests.py
cedar-backup2/trunk/testcase/cdwritertests.py
cedar-backup2/trunk/testcase/configtests.py
cedar-backup2/trunk/testcase/dvdwritertests.py
cedar-backup2/trunk/testcase/encrypttests.py
cedar-backup2/trunk/testcase/filesystemtests.py
cedar-backup2/trunk/testcase/mboxtests.py
cedar-backup2/trunk/testcase/mysqltests.py
cedar-backup2/trunk/testcase/peertests.py
cedar-backup2/trunk/testcase/postgresqltests.py
cedar-backup2/trunk/testcase/splittests.py
cedar-backup2/trunk/testcase/subversiontests.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/testcase/writersutiltests.py
cedar-backup2/trunk/util/test.py
Added Paths:
-----------
cedar-backup2/trunk/testcase/
Removed Paths:
-------------
cedar-backup2/trunk/test/
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-06-30 22:56:19 UTC (rev 981)
+++ cedar-backup2/trunk/Changelog 2010-06-30 23:03:17 UTC (rev 982)
@@ -1,7 +1,8 @@
Version 2.19.7 unreleased
* Configure pylint and execute it against the entire codebase.
- * Fix a variety of minor warnings and suggestions from pylint.
+ - Fix a variety of minor warnings and suggestions from pylint
+ - Move unit tests into testcase folder to avoid test.py naming conflict
Version 2.19.6 22 May 2010
Property changes on: cedar-backup2/trunk/testcase
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: cedar-backup2/trunk/testcase/actionsutiltests.py
===================================================================
--- cedar-backup2/trunk/test/actionsutiltests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/actionsutiltests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -88,7 +88,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "tree1.tar.gz", "tree8.tar.gz", "tree15.tar.gz", "tree17.tar.gz",
"tree18.tar.gz", "tree19.tar.gz", "tree20.tar.gz", ]
Modified: cedar-backup2/trunk/testcase/capacitytests.py
===================================================================
--- cedar-backup2/trunk/test/capacitytests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/capacitytests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -106,7 +106,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "capacity.conf.1", "capacity.conf.2", "capacity.conf.3", "capacity.conf.4", ]
Modified: cedar-backup2/trunk/testcase/cdwritertests.py
===================================================================
--- cedar-backup2/trunk/test/cdwritertests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/cdwritertests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -125,7 +125,7 @@
ILEAD = (11400.0*2048.0) # Initial lead-in
SLEAD = (6900.0*2048.0) # Session lead-in
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "tree9.tar.gz", ]
SUDO_CMD = [ "sudo", ]
Modified: cedar-backup2/trunk/testcase/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/configtests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -116,7 +116,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "cback.conf.1", "cback.conf.2", "cback.conf.3", "cback.conf.4",
"cback.conf.5", "cback.conf.6", "cback.conf.7", "cback.conf.8",
"cback.conf.9", "cback.conf.10", "cback.conf.11", "cback.conf.12",
Modified: cedar-backup2/trunk/testcase/dvdwritertests.py
===================================================================
--- cedar-backup2/trunk/test/dvdwritertests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/dvdwritertests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -107,7 +107,7 @@
GB44 = (4.4*1024.0*1024.0*1024.0) # 4.4 GB
GB44SECTORS = GB44/2048.0 # 4.4 GB in 2048-byte sectors
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "tree9.tar.gz", ]
Modified: cedar-backup2/trunk/testcase/encrypttests.py
===================================================================
--- cedar-backup2/trunk/test/encrypttests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/encrypttests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -117,7 +117,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "encrypt.conf.1", "encrypt.conf.2", "tree1.tar.gz", "tree2.tar.gz",
"tree8.tar.gz", "tree15.tar.gz", "tree16.tar.gz", "tree17.tar.gz",
"tree18.tar.gz", "tree19.tar.gz", "tree20.tar.gz", ]
Modified: cedar-backup2/trunk/testcase/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/test/filesystemtests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/filesystemtests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -128,7 +128,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data" ]
+DATA_DIRS = [ "./data", "./testcase/data" ]
RESOURCES = [ "tree1.tar.gz", "tree2.tar.gz", "tree3.tar.gz", "tree4.tar.gz", "tree5.tar.gz",
"tree6.tar.gz", "tree7.tar.gz", "tree8.tar.gz", "tree9.tar.gz", "tree10.tar.gz",
"tree11.tar.gz", "tree12.tar.gz", "tree13.tar.gz", "tree22.tar.gz", ]
Modified: cedar-backup2/trunk/testcase/mboxtests.py
===================================================================
--- cedar-backup2/trunk/test/mboxtests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/mboxtests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -109,7 +109,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "mbox.conf.1", "mbox.conf.2", "mbox.conf.3", "mbox.conf.4", ]
Modified: cedar-backup2/trunk/testcase/mysqltests.py
===================================================================
--- cedar-backup2/trunk/test/mysqltests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/mysqltests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -119,7 +119,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "mysql.conf.1", "mysql.conf.2", "mysql.conf.3", "mysql.conf.4", "mysql.conf.5", ]
Modified: cedar-backup2/trunk/testcase/peertests.py
===================================================================
--- cedar-backup2/trunk/test/peertests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/peertests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -110,7 +110,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "tree1.tar.gz", "tree2.tar.gz", "tree9.tar.gz", ]
REMOTE_HOST = "localhost" # Always use login@localhost as our "remote" host
Modified: cedar-backup2/trunk/testcase/postgresqltests.py
===================================================================
--- cedar-backup2/trunk/test/postgresqltests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/postgresqltests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -119,7 +119,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "postgresql.conf.1", "postgresql.conf.2", "postgresql.conf.3", "postgresql.conf.4", "postgresql.conf.5", ]
Modified: cedar-backup2/trunk/testcase/splittests.py
===================================================================
--- cedar-backup2/trunk/test/splittests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/splittests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -121,7 +121,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "split.conf.1", "split.conf.2", "split.conf.3", "split.conf.4", "split.conf.5", "tree21.tar.gz", ]
INVALID_PATH = "bogus" # This path name should never exist
Modified: cedar-backup2/trunk/testcase/subversiontests.py
===================================================================
--- cedar-backup2/trunk/test/subversiontests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/subversiontests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -121,7 +121,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "subversion.conf.1", "subversion.conf.2", "subversion.conf.3", "subversion.conf.4",
"subversion.conf.5", "subversion.conf.6", "subversion.conf.7", ]
Modified: cedar-backup2/trunk/testcase/utiltests.py
===================================================================
--- cedar-backup2/trunk/test/utiltests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/utiltests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -97,7 +97,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data" ]
+DATA_DIRS = [ "./data", "./testcase/data" ]
RESOURCES = [ "lotsoflines.py", "tree10.tar.gz", ]
Modified: cedar-backup2/trunk/testcase/writersutiltests.py
===================================================================
--- cedar-backup2/trunk/test/writersutiltests.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/testcase/writersutiltests.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -108,7 +108,7 @@
# Module-wide configuration and constants
#######################################################################
-DATA_DIRS = [ "./data", "./test/data", ]
+DATA_DIRS = [ "./data", "./testcase/data", ]
RESOURCES = [ "tree9.tar.gz", ]
SUDO_CMD = [ "sudo", ]
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2010-06-30 22:56:19 UTC (rev 981)
+++ cedar-backup2/trunk/util/test.py 2010-06-30 23:03:17 UTC (rev 982)
@@ -140,34 +140,34 @@
# Import the unit test modules
try:
- if os.path.exists(os.path.join(".", "test", "filesystemtests.py")):
+ if os.path.exists(os.path.join(".", "testcase", "filesystemtests.py")):
sys.path.insert(0, ".")
- elif os.path.basename(os.getcwd()) == "test" and os.path.exists(os.path.join("..", "test", "filesystemtests.py")):
+ elif os.path.basename(os.getcwd()) == "testcase" and os.path.exists(os.path.join("..", "testcase", "filesystemtests.py")):
sys.path.insert(0, "..")
else:
print "WARNING: CedarBackup2 unit test modules were not found in"
print "the expected location. If the import succeeds, you may be"
print "using an unexpected version of the test suite."
print ""
- import test.utiltests as utiltests
- import test.knapsacktests as knapsacktests
- import test.filesystemtests as filesystemtests
- import test.peertests as peertests
- import test.actionsutiltests as actionsutiltests
- import test.writersutiltests as writersutiltests
- import test.cdwritertests as cdwritertests
- import test.dvdwritertests as dvdwritertests
- import test.configtests as configtests
- import test.clitests as clitests
- import test.mysqltests as mysqltests
- import test.postgresqltests as postgresqltests
- import test.subversiontests as subversiontests
- import test.mboxtests as mboxtests
- import test.encrypttests as encrypttests
- import test.splittests as splittests
- import test.spantests as spantests
- import test.capacitytests as capacitytests
- import test.customizetests as customizetests
+ from testcase import utiltests
+ from testcase import knapsacktests
+ from testcase import filesystemtests
+ from testcase import peertests
+ from testcase import actionsutiltests
+ from testcase import writersutiltests
+ from testcase import cdwritertests
+ from testcase import dvdwritertests
+ from testcase import configtests
+ from testcase import clitests
+ from testcase import mysqltests
+ from testcase import postgresqltests
+ from testcase import subversiontests
+ from testcase import mboxtests
+ from testcase import encrypttests
+ from testcase import splittests
+ from testcase import spantests
+ from testcase import capacitytests
+ from testcase import customizetests
except ImportError, e:
print "Failed to import CedarBackup2 unit test module: %s" % e
print "You must either run the unit tests from the CedarBackup2 source"
@@ -235,9 +235,9 @@
# Create and run the test suite
print ""
suite = unittest.TestSuite(unittests.values())
- result = unittest.TextTestRunner(verbosity=1).run(suite)
+ suiteResult = unittest.TextTestRunner(verbosity=1).run(suite)
print ""
- if not result.wasSuccessful():
+ if not suiteResult.wasSuccessful():
return 1
else:
return 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 03:35:01
|
Revision: 984
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=984&view=rev
Author: pronovic
Date: 2010-07-01 03:34:55 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Switch maintainer makefile to use pylint
Modified Paths:
--------------
cedar-backup2/trunk/Makefile
Added Paths:
-----------
cedar-backup2/trunk/doc/obsolete/
cedar-backup2/trunk/doc/obsolete/Makefile.pychecker
cedar-backup2/trunk/doc/obsolete/pycheckrc
cedar-backup2/trunk/pylint-code.rc
cedar-backup2/trunk/pylint-test.rc
Removed Paths:
-------------
cedar-backup2/trunk/pycheckrc
cedar-backup2/trunk/pylintrc
Modified: cedar-backup2/trunk/Makefile
===================================================================
--- cedar-backup2/trunk/Makefile 2010-07-01 03:34:29 UTC (rev 983)
+++ cedar-backup2/trunk/Makefile 2010-07-01 03:34:55 UTC (rev 984)
@@ -35,8 +35,8 @@
EPYDOC = epydoc
FIND = find
MKDIR = mkdir
-PYCHECKER = PYTHONVER=2.4 pychecker
-PYTHON = python2.4
+PYLINT = pylint
+PYTHON = python
RM = rm
SETUP = $(PYTHON) ./setup.py
SUDO = sudo
@@ -85,30 +85,17 @@
##################################
# Stylistic and function checking
##################################
-# Pycheck catches a lot of different things. It's kind of like lint for
-# Python. A few warnings are expected. The main check rule only checks the
-# implementation in CedarBackup2/. The other rule checks all of the python
-# code in the system.
-#
-# Normally, I would run just one command-line here, but it turns out that
-# having util.py and writers/util.py (i.e. duplicated names) confuses
-# pychecker.
+# Previously, I used pychecker. However, it's getting a little long in the
+# tooth, and it doesn't work as well with newer versions of Python. I've
+# switched to pylint, which seems a bit more reliable and can be configured at
+# a finer-grained level.
-check:
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/actions/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/extend/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/tools/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/writers/*.py 2>/dev/null
+check:
+ -@$(PYLINT) --rcfile=pylint-code.rc CedarBackup2
-allcheck:
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/actions/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/extend/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/tools/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc CedarBackup2/writers/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc test/*.py 2>/dev/null
- -@$(PYCHECKER) --config pycheckrc util/*.py 2>/dev/null
+allcheck:
+ -@$(PYLINT) --rcfile=pylint-code.rc CedarBackup2 util setup.py
+ -@$(PYLINT) --rcfile=pylint-test.rc testcase
################
Added: cedar-backup2/trunk/doc/obsolete/Makefile.pychecker
===================================================================
--- cedar-backup2/trunk/doc/obsolete/Makefile.pychecker (rev 0)
+++ cedar-backup2/trunk/doc/obsolete/Makefile.pychecker 2010-07-01 03:34:55 UTC (rev 984)
@@ -0,0 +1,32 @@
+##################################
+# Stylistic and function checking
+##################################
+# Pycheck catches a lot of different things. It's kind of like lint for
+# Python. A few warnings are expected. The main check rule only checks the
+# implementation in CedarBackup2/. The other rule checks all of the python
+# code in the system.
+#
+# Normally, I would run just one command-line here, but it turns out that
+# having util.py and writers/util.py (i.e. duplicated names) confuses
+# pychecker.
+
+PYCHECKER = PYTHONVER=2.4 pychecker
+
+check:
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/actions/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/extend/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/tools/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/writers/*.py 2>/dev/null
+
+allcheck:
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/actions/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/extend/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/tools/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc CedarBackup2/writers/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc test/*.py 2>/dev/null
+ -@$(PYCHECKER) --config pycheckrc util/*.py 2>/dev/null
+
+.PHONY: check allcheck
+
Property changes on: cedar-backup2/trunk/doc/obsolete/Makefile.pychecker
___________________________________________________________________
Added: svn:keywords
+ Id
Copied: cedar-backup2/trunk/doc/obsolete/pycheckrc (from rev 982, cedar-backup2/trunk/pycheckrc)
===================================================================
--- cedar-backup2/trunk/doc/obsolete/pycheckrc (rev 0)
+++ cedar-backup2/trunk/doc/obsolete/pycheckrc 2010-07-01 03:34:55 UTC (rev 984)
@@ -0,0 +1,19 @@
+# list of strings: ignore unused locals/arguments if name is one of
+unusedNames = [ 'i', 'object', 'value', 'config', 'options', 'configPath', 'addSelf', ]
+
+# bool: ignore all warnings from standard library components
+# (this includes anything under the standard library, eg, site-packages)
+ignoreStandardLibrary = 1
+
+# int: warnings for code complexity, max value before generating a warning
+maxLocals = 50 # some test code has a lot of variables
+maxLines = 350 # some test code has some huge methods
+maxArgs = 15 # configuration code has a lot of method arguments
+maxReturns = 35 # configuration and cli code implement __cmp__ with lots of returns
+
+# bool: check consistent return values
+checkReturnValues = 0 # subversion code wants to mix file(), GzipFile() and BZ2File()
+
+# list of strings: ignore warnings generated from these modules
+blacklist = [ 'xml', 'popen2', 'ConfigParser', 'posixpath', ]
+
Property changes on: cedar-backup2/trunk/doc/obsolete/pycheckrc
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: cedar-backup2/trunk/pycheckrc
===================================================================
--- cedar-backup2/trunk/pycheckrc 2010-07-01 03:34:29 UTC (rev 983)
+++ cedar-backup2/trunk/pycheckrc 2010-07-01 03:34:55 UTC (rev 984)
@@ -1,19 +0,0 @@
-# list of strings: ignore unused locals/arguments if name is one of
-unusedNames = [ 'i', 'object', 'value', 'config', 'options', 'configPath', 'addSelf', ]
-
-# bool: ignore all warnings from standard library components
-# (this includes anything under the standard library, eg, site-packages)
-ignoreStandardLibrary = 1
-
-# int: warnings for code complexity, max value before generating a warning
-maxLocals = 50 # some test code has a lot of variables
-maxLines = 350 # some test code has some huge methods
-maxArgs = 15 # configuration code has a lot of method arguments
-maxReturns = 35 # configuration and cli code implement __cmp__ with lots of returns
-
-# bool: check consistent return values
-checkReturnValues = 0 # subversion code wants to mix file(), GzipFile() and BZ2File()
-
-# list of strings: ignore warnings generated from these modules
-blacklist = [ 'xml', 'popen2', 'ConfigParser', 'posixpath', ]
-
Added: cedar-backup2/trunk/pylint-code.rc
===================================================================
--- cedar-backup2/trunk/pylint-code.rc (rev 0)
+++ cedar-backup2/trunk/pylint-code.rc 2010-07-01 03:34:55 UTC (rev 984)
@@ -0,0 +1,327 @@
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Pylint configuration for most source code.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+# lint Python modules using external checkers.
+#
+# This is the main checker controling the other ones and the reports
+# generation. It is itself both a raw checker and an astng checker in order
+# to:
+# * handle message activation / deactivation at the module level
+# * handle some basic but necessary stats'data (number of classes, methods...)
+#
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add <file or directory> to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=.svn
+ignore=.hg
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+disable-msg=I0011,W0702,W0703,W0704,C0302,C0321,R0902,R0911,R0912,R0913,R0914,R0915
+
+
+[REPORTS]
+
+# set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=yes
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells wether to display a full report or only the messages
+reports=no
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note).You have access to the variables errors warning, statement which
+# respectivly contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branchs, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__
+
+# Regular expression which should only match correct module names
+module-rgx=((CedarBackup2)|([a-z][a-z0-9]*))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][A-Za-z0-9]{1,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=((__[a-z]*__$)|([a-z_][A-Za-z0-9]{1,30})|(test[A-Z][A-Za-z0-9]+(_[0-9]{1,3}[a-z]{0,1}){0,1}))$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct argument names
+argument-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct variable names
+variable-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=logger,outputLogger,result
+
+# Bad variable names which should always be refused, separated by a comma
+#bad-names=foo,bar,baz,toto,tutu,tata
+bad-names=
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells wether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamicaly set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, consider the acquired-members option to ignore
+# access to some undefined attributes.
+zope=no
+
+# List of members which are usually get through zope's acquisition mecanism and
+# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
+acquired-members=
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assigment
+#
+[VARIABLES]
+
+# Tells wether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=6
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=0
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existant members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+# 50 lines of similarity basically turns this off; I don't care about it
+min-similarity-lines=50
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+# Technically, we like to use 132 characters, but there's a little leeway
+max-line-length=136
+
+# Maximum number of lines in a module
+max-module-lines=2000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
+indent-string=' '
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,TODO
Added: cedar-backup2/trunk/pylint-test.rc
===================================================================
--- cedar-backup2/trunk/pylint-test.rc (rev 0)
+++ cedar-backup2/trunk/pylint-test.rc 2010-07-01 03:34:55 UTC (rev 984)
@@ -0,0 +1,331 @@
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Pylint configuration for unit tests.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# The primary difference between this configuration and the main
+# pylintrc config file is the set of messages which are ignored.
+# There are certain warnings we just don't care about in unit tests.
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+# lint Python modules using external checkers.
+#
+# This is the main checker controling the other ones and the reports
+# generation. It is itself both a raw checker and an astng checker in order
+# to:
+# * handle message activation / deactivation at the module level
+# * handle some basic but necessary stats'data (number of classes, methods...)
+#
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add <file or directory> to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=.svn
+ignore=.hg
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+disable-msg=I0011,W0212,W0702,W0703,W0704,C0302,C0301,C0321,C0111,R0201,R0902,R0904,R0911,R0912,R0913,R0914,R0915
+
+
+[REPORTS]
+
+# set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=yes
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells wether to display a full report or only the messages
+reports=no
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note).You have access to the variables errors warning, statement which
+# respectivly contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branchs, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__
+
+# Regular expression which should only match correct module names
+module-rgx=((CedarBackup2)|([a-z][a-z0-9]*))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][A-Za-z0-9]{1,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=((__[a-z]*__$)|([a-z_][A-Za-z0-9]{1,30})|(test[A-Z][A-Za-z0-9]+(_[0-9]{1,3}[a-z]{0,1}){0,1}))$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct argument names
+argument-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct variable names
+variable-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=(([a-z])|([a-z_][A-Za-z0-9]{1,30}))$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=logger,outputLogger,result
+
+# Bad variable names which should always be refused, separated by a comma
+#bad-names=foo,bar,baz,toto,tutu,tata
+bad-names=
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells wether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamicaly set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, consider the acquired-members option to ignore
+# access to some undefined attributes.
+zope=no
+
+# List of members which are usually get through zope's acquisition mecanism and
+# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
+acquired-members=
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assigment
+#
+[VARIABLES]
+
+# Tells wether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=6
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=0
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existant members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+# 50 lines of similarity basically turns this off; I don't care about it
+min-similarity-lines=50
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+# Technically, we like to use 132 characters, but there's a little leeway
+max-line-length=136
+
+# Maximum number of lines in a module
+max-module-lines=2000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
+indent-string=' '
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,TODO
Deleted: cedar-backup2/trunk/pylintrc
===================================================================
--- cedar-backup2/trunk/pylintrc 2010-07-01 03:34:29 UTC (rev 983)
+++ cedar-backup2/trunk/pylintrc 2010-07-01 03:34:55 UTC (rev 984)
@@ -1,312 +0,0 @@
-# lint Python modules using external checkers.
-#
-# This is the main checker controling the other ones and the reports
-# generation. It is itself both a raw checker and an astng checker in order
-# to:
-# * handle message activation / deactivation at the module level
-# * handle some basic but necessary stats'data (number of classes, methods...)
-#
-[MASTER]
-
-# Specify a configuration file.
-#rcfile=
-
-# Python code to execute, usually for sys.path manipulation such as
-# pygtk.require().
-#init-hook=
-
-# Profiled execution.
-profile=no
-
-# Add <file or directory> to the black list. It should be a base name, not a
-# path. You may set this option multiple times.
-ignore=.svn
-ignore=.hg
-
-# Pickle collected data for later comparisons.
-persistent=yes
-
-# Set the cache size for astng objects.
-cache-size=500
-
-# List of plugins (as comma separated values of python modules names) to load,
-# usually to register additional checkers.
-load-plugins=
-
-
-[MESSAGES CONTROL]
-
-# Enable only checker(s) with the given id(s). This option conflicts with the
-# disable-checker option
-#enable-checker=
-
-# Enable all checker(s) except those with the given id(s). This option
-# conflicts with the enable-checker option
-#disable-checker=
-
-# Enable all messages in the listed categories.
-#enable-msg-cat=
-
-# Disable all messages in the listed categories.
-#disable-msg-cat=
-
-# Enable the message(s) with the given id(s).
-#enable-msg=
-
-# Disable the message(s) with the given id(s).
-disable-msg=I0011,W0702,W0703,W0704,C0302,C0321,R0902,R0911,R0912,R0913,R0914,R0915
-
-
-[REPORTS]
-
-# set the output format. Available formats are text, parseable, colorized, msvs
-# (visual studio) and html
-output-format=text
-
-# Inclu...
[truncated message content] |
|
From: <pro...@us...> - 2010-07-01 14:53:20
|
Revision: 986
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=986&view=rev
Author: pronovic
Date: 2010-07-01 14:53:14 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Prepare to release 2.19.7
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-07-01 03:55:08 UTC (rev 985)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-07-01 14:53:14 UTC (rev 986)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
-VERSION = "2.19.6"
-DATE = "22 May 2010"
+VERSION = "2.19.7"
+DATE = "01 Jul 2010"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-01 03:55:08 UTC (rev 985)
+++ cedar-backup2/trunk/Changelog 2010-07-01 14:53:14 UTC (rev 986)
@@ -1,4 +1,4 @@
-Version 2.19.7 unreleased
+Version 2.19.7 01 Jul 2010
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 17:53:55
|
Revision: 992
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=992&view=rev
Author: pronovic
Date: 2010-07-01 17:53:49 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Make cback script more robust in the case of a bad interpreter version.
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/cback
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-01 16:27:06 UTC (rev 991)
+++ cedar-backup2/trunk/Changelog 2010-07-01 17:53:49 UTC (rev 992)
@@ -1,5 +1,6 @@
Version 2.19.7 01 Jul 2010
+ * Make cback script more robust in the case of a bad interpreter version.
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
- Move unit tests into testcase folder to avoid test.py naming conflict
Modified: cedar-backup2/trunk/cback
===================================================================
--- cedar-backup2/trunk/cback 2010-07-01 16:27:06 UTC (rev 991)
+++ cedar-backup2/trunk/cback 2010-07-01 17:53:49 UTC (rev 992)
@@ -22,8 +22,14 @@
@author: Kenneth J. Pronovici <pro...@ie...>
"""
-import sys
-from CedarBackup2.cli import cli
+try:
+ import sys
+ from CedarBackup2.cli import cli
+except ImportError, e:
+ print "Failed to import Python modules: %s" % e
+ print "Are you running a proper version of Python?"
+ sys.exit(1)
+
result = cli()
sys.exit(result)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 18:50:40
|
Revision: 995
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=995&view=rev
Author: pronovic
Date: 2010-07-07 18:50:34 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-01 17:54:16 UTC (rev 994)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-07 18:50:34 UTC (rev 995)
@@ -54,7 +54,7 @@
# Cedar Backup modules
from CedarBackup2.peer import RemotePeer, LocalPeer
-from CedarBackup2.util import getUidGid, changeOwnership, isStartOfWeek
+from CedarBackup2.util import getUidGid, changeOwnership, isStartOfWeek, isRunningAsRoot
from CedarBackup2.actions.constants import DIR_TIME_FORMAT, STAGE_INDICATOR
from CedarBackup2.actions.util import writeIndicatorFile
@@ -120,7 +120,7 @@
continue
logger.debug("Found collect indicator.")
targetDir = stagingDirs[peer.name]
- if os.getuid() == 0:
+ if isRunningAsRoot():
# Since we're running as root, we can change ownership
ownership = getUidGid(config.options.backupUser, config.options.backupGroup)
logger.debug("Using target dir [%s], ownership [%d:%d]." % (targetDir, ownership[0], ownership[1]))
@@ -319,7 +319,7 @@
@param config: Config object.
@return: Name of local user that should be used
"""
- if os.getuid() != 0:
+ if not isRunningAsRoot():
return None
return config.options.backupUser
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-01 17:54:16 UTC (rev 994)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 18:50:34 UTC (rev 995)
@@ -59,7 +59,7 @@
# Cedar Backup modules
from CedarBackup2.filesystem import FilesystemList
-from CedarBackup2.util import resolveCommand, executeCommand
+from CedarBackup2.util import resolveCommand, executeCommand, isRunningAsRoot
from CedarBackup2.util import splitCommandLine, encodePath
from CedarBackup2.config import VALID_FAILURE_MODES
@@ -1010,7 +1010,7 @@
beforeSet = RemotePeer._getDirContents(targetDir)
if localUser is not None:
try:
- if os.getuid() != 0:
+ if not isRunningAsRoot():
raise IOError("Only root can remote copy as another user.")
except AttributeError: pass
actualCommand = "%s %s@%s:%s/* %s" % (rcpCommand, remoteUser, remoteHost, sourceDir, targetDir)
@@ -1103,7 +1103,7 @@
raise IOError("Target file [%s] already exists." % targetFile)
if localUser is not None:
try:
- if os.getuid() != 0:
+ if not isRunningAsRoot():
raise IOError("Only root can remote copy as another user.")
except AttributeError: pass
actualCommand = "%s %s@%s:%s %s" % (rcpCommand, remoteUser, remoteHost, sourceFile.replace(" ", "\\ "), targetFile)
@@ -1174,7 +1174,7 @@
raise IOError("Target file [%s] already exists." % targetFile)
if localUser is not None:
try:
- if os.getuid() != 0:
+ if not isRunningAsRoot():
raise IOError("Only root can remote copy as another user.")
except AttributeError: pass
actualCommand = '%s "%s" "%s@%s:%s"' % (rcpCommand, sourceFile, remoteUser, remoteHost, targetFile)
@@ -1217,7 +1217,7 @@
actualCommand = "%s %s@%s '%s'" % (rshCommand, remoteUser, remoteHost, remoteCommand)
if localUser is not None:
try:
- if os.getuid() != 0:
+ if not isRunningAsRoot():
raise IOError("Only root can remote shell as another user.")
except AttributeError: pass
command = resolveCommand(SU_COMMAND)
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-01 17:54:16 UTC (rev 994)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 18:50:34 UTC (rev 995)
@@ -1347,7 +1347,6 @@
try:
uid = pwd.getpwnam(user)[2]
gid = grp.getgrnam(group)[2]
- logger.debug("Translated [%s:%s] into [%d:%d]." % (user, group, uid, gid))
return (uid, gid)
except Exception, e:
logger.debug("Error looking up uid and gid for [%s:%s]: %s" % (user, group, e))
@@ -1365,7 +1364,8 @@
Changes ownership of path to match the user and group.
This is a no-op if user/group functionality is not available on the
- platform, or if the either passed-in user or group is C{None}.
+ platform, or if the either passed-in user or group is C{None}. Further, we
+ won't even try to do it unless running as root, since it's unlikely to work.
@param path: Path whose ownership to change.
@param user: User which owns file.
@@ -1374,7 +1374,7 @@
if _UID_GID_AVAILABLE:
if user is None or group is None:
logger.debug("User or group is None, so not attempting to change owner on [%s]." % path)
- elif os.getuid() != 0:
+ elif not isRunningAsRoot():
logger.debug("Not root, so not attempting to change owner on [%s]." % path)
else:
try:
@@ -1384,6 +1384,17 @@
logger.error("Error changing ownership of [%s]: %s" % (path, e))
+#############################
+# isRunningAsRoot() function
+#############################
+
+def isRunningAsRoot():
+ """
+ Indicates whether the program is running as the root user.
+ """
+ return os.getuid() == 0
+
+
##############################
# splitCommandLine() function
##############################
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-01 17:54:16 UTC (rev 994)
+++ cedar-backup2/trunk/Changelog 2010-07-07 18:50:34 UTC (rev 995)
@@ -1,6 +1,8 @@
Version 2.19.7 01 Jul 2010
* Make cback script more robust in the case of a bad interpreter version.
+ * Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
+ * Refactor out isRunningAsRoot() to replace scattered os.getuid() calls.
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
- Move unit tests into testcase folder to avoid test.py naming conflict
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-01 17:54:16 UTC (rev 994)
+++ cedar-backup2/trunk/TODO 2010-07-07 18:50:34 UTC (rev 995)
@@ -32,10 +32,6 @@
Can configuration be generalized, or is code the right
way to do it?
-Ugh, we're inconsistent and some code still calls os.chmod and os.chown directly?
-
-Maybe we need an isRunningAsRoot() function rather than getuid() all over the place?
-
============================
Move to Python 2.5 -- is available in etch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 19:56:16
|
Revision: 998
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=998&view=rev
Author: pronovic
Date: 2010-07-07 19:56:08 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Change file headers, comments, manual, etc. to reference Python 2.5
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/__init__.py
cedar-backup2/trunk/CedarBackup2/action.py
cedar-backup2/trunk/CedarBackup2/actions/__init__.py
cedar-backup2/trunk/CedarBackup2/actions/collect.py
cedar-backup2/trunk/CedarBackup2/actions/constants.py
cedar-backup2/trunk/CedarBackup2/actions/initialize.py
cedar-backup2/trunk/CedarBackup2/actions/purge.py
cedar-backup2/trunk/CedarBackup2/actions/rebuild.py
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/actions/store.py
cedar-backup2/trunk/CedarBackup2/actions/util.py
cedar-backup2/trunk/CedarBackup2/actions/validate.py
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/customize.py
cedar-backup2/trunk/CedarBackup2/extend/__init__.py
cedar-backup2/trunk/CedarBackup2/extend/capacity.py
cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
cedar-backup2/trunk/CedarBackup2/extend/mbox.py
cedar-backup2/trunk/CedarBackup2/extend/mysql.py
cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
cedar-backup2/trunk/CedarBackup2/extend/split.py
cedar-backup2/trunk/CedarBackup2/extend/subversion.py
cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/image.py
cedar-backup2/trunk/CedarBackup2/knapsack.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/CedarBackup2/tools/__init__.py
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/CedarBackup2/writer.py
cedar-backup2/trunk/CedarBackup2/writers/__init__.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/util.py
cedar-backup2/trunk/CedarBackup2/xmlutil.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/INSTALL
cedar-backup2/trunk/cback
cedar-backup2/trunk/doc/cback-span.1
cedar-backup2/trunk/doc/cback.1
cedar-backup2/trunk/manual/src/depends.xml
cedar-backup2/trunk/manual/src/install.xml
cedar-backup2/trunk/setup.py
cedar-backup2/trunk/testcase/__init__.py
cedar-backup2/trunk/testcase/actionsutiltests.py
cedar-backup2/trunk/testcase/capacitytests.py
cedar-backup2/trunk/testcase/cdwritertests.py
cedar-backup2/trunk/testcase/clitests.py
cedar-backup2/trunk/testcase/configtests.py
cedar-backup2/trunk/testcase/customizetests.py
cedar-backup2/trunk/testcase/dvdwritertests.py
cedar-backup2/trunk/testcase/encrypttests.py
cedar-backup2/trunk/testcase/filesystemtests.py
cedar-backup2/trunk/testcase/knapsacktests.py
cedar-backup2/trunk/testcase/mboxtests.py
cedar-backup2/trunk/testcase/mysqltests.py
cedar-backup2/trunk/testcase/peertests.py
cedar-backup2/trunk/testcase/postgresqltests.py
cedar-backup2/trunk/testcase/spantests.py
cedar-backup2/trunk/testcase/splittests.py
cedar-backup2/trunk/testcase/subversiontests.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/testcase/writersutiltests.py
cedar-backup2/trunk/util/__init__.py
cedar-backup2/trunk/util/cback-span
cedar-backup2/trunk/util/createtree.py
cedar-backup2/trunk/util/knapsackdemo.py
cedar-backup2/trunk/util/test.py
Modified: cedar-backup2/trunk/CedarBackup2/__init__.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/__init__.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides package initialization
Modified: cedar-backup2/trunk/CedarBackup2/action.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/action.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/action.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides implementation of various backup-related actions.
Modified: cedar-backup2/trunk/CedarBackup2/actions/__init__.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/__init__.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides package initialization
Modified: cedar-backup2/trunk/CedarBackup2/actions/collect.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/collect.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/collect.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'collect' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/constants.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/constants.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/constants.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides common constants used by standard actions.
Modified: cedar-backup2/trunk/CedarBackup2/actions/initialize.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/initialize.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/initialize.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'initialize' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/purge.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/purge.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/purge.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'purge' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/rebuild.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/rebuild.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/rebuild.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'rebuild' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'stage' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/store.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'store' action.
Modified: cedar-backup2/trunk/CedarBackup2/actions/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements action-related utilities
Modified: cedar-backup2/trunk/CedarBackup2/actions/validate.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/validate.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/actions/validate.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements the standard 'validate' action.
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides command-line interface implementation.
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides configuration-related objects.
@@ -295,8 +295,8 @@
precision can be avoided. It really isn't possible to store a floating
point number here while being able to losslessly translate back and forth
between XML and object representations. (Perhaps the Python 2.4 Decimal
- class would have been an option, but I want to stay compatible with Python
- 2.3.)
+ class would have been an option, but I originally wanted to stay compatible
+ with Python 2.3.)
Even though the quantity is maintained as a string, the string must be in a
valid floating point positive number. Technically, any floating point
Modified: cedar-backup2/trunk/CedarBackup2/customize.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/customize.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/customize.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements customized behavior.
Modified: cedar-backup2/trunk/CedarBackup2/extend/__init__.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/__init__.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides package initialization
Modified: cedar-backup2/trunk/CedarBackup2/extend/capacity.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides an extension to check remaining media capacity.
@@ -82,8 +82,8 @@
precision can be avoided. It really isn't possible to store a floating
point number here while being able to losslessly translate back and forth
between XML and object representations. (Perhaps the Python 2.4 Decimal
- class would have been an option, but I want to stay compatible with Python
- 2.3.)
+ class would have been an option, but I originally wanted to stay compatible
+ with Python 2.3.)
Even though the quantity is maintained as a string, the string must be in a
valid floating point positive number. Technically, any floating point
Modified: cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to encrypt staging directories.
Modified: cedar-backup2/trunk/CedarBackup2/extend/mbox.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to back up mbox email files.
Modified: cedar-backup2/trunk/CedarBackup2/extend/mysql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to back up MySQL databases.
Modified: cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -27,7 +27,7 @@
#
# Author : Kenneth J. Pronovici <pro...@ie...>
# Antoine Beaupre <an...@ko...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to back up PostgreSQL databases.
Modified: cedar-backup2/trunk/CedarBackup2/extend/split.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to split up large files in staging directories.
Modified: cedar-backup2/trunk/CedarBackup2/extend/subversion.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to back up Subversion repositories.
Modified: cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides an extension to save off important system recovery information.
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides filesystem-related objects.
Modified: cedar-backup2/trunk/CedarBackup2/image.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/image.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/image.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides interface backwards compatibility.
Modified: cedar-backup2/trunk/CedarBackup2/knapsack.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/knapsack.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/knapsack.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides knapsack algorithms used for "fit" decisions
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides backup peer-related objects.
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides location to maintain release information.
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides unit-testing utilities.
Modified: cedar-backup2/trunk/CedarBackup2/tools/__init__.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/tools/__init__.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Tools
# Revision : $Id$
# Purpose : Provides package initialization
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Spans staged data among multiple discs
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -28,7 +28,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides general-purpose utilities.
@@ -1127,7 +1127,10 @@
def sortDict(d):
"""
Returns the keys of the dictionary sorted by value.
- There are cuter ways to do this in Python 2.4, but we're compatible with 2.3.
+
+ There are cuter ways to do this in Python 2.4, but we were originally
+ attempting to stay compatible with Python 2.3.
+
@param d: Dictionary to operate on
@return: List of dictionary keys sorted in order by dictionary value.
"""
Modified: cedar-backup2/trunk/CedarBackup2/writer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writer.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/writer.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides interface backwards compatibility.
Modified: cedar-backup2/trunk/CedarBackup2/writers/__init__.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/writers/__init__.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -9,7 +9,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Official Cedar Backup Extensions
# Revision : $Id$
# Purpose : Provides package initialization
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides functionality related to CD writer devices.
Modified: cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides functionality related to DVD writer devices.
Modified: cedar-backup2/trunk/CedarBackup2/writers/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -25,7 +25,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides utilities related to image writers.
Modified: cedar-backup2/trunk/CedarBackup2/xmlutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/xmlutil.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/CedarBackup2/xmlutil.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -28,7 +28,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Provides general XML-related functionality.
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/Changelog 2010-07-07 19:56:08 UTC (rev 998)
@@ -1,9 +1,10 @@
-Version 2.19.7 unreleased
+Version 2.20.0 unreleased
* Make cback script more robust in the case of a bad interpreter version.
* Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
* Refactor out util.isRunningAsR...
[truncated message content] |
|
From: <pro...@us...> - 2010-07-07 19:58:31
|
Revision: 999
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=999&view=rev
Author: pronovic
Date: 2010-07-07 19:58:25 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Change interpreter checks
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/util/test.py
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:56:08 UTC (rev 998)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:58:25 UTC (rev 999)
@@ -169,7 +169,7 @@
A different error code is returned for each type of failure:
- - C{1}: The Python interpreter version is < 2.3
+ - C{1}: The Python interpreter version is < 2.5
- C{2}: Error processing command-line arguments
- C{3}: Error configuring logging
- C{4}: Error parsing indicated configuration file
@@ -187,12 +187,12 @@
@return: Error code as described above.
"""
try:
- if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 3]:
- sys.stderr.write("Python version 2.3 or greater required.\n")
+ if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 5]:
+ sys.stderr.write("Python version 2.5 or greater required.\n")
return 1
except:
# sys.version_info isn't available before 2.0
- sys.stderr.write("Python version 2.3 or greater required.\n")
+ sys.stderr.write("Python version 2.5 or greater required.\n")
return 1
try:
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-07-07 19:56:08 UTC (rev 998)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-07-07 19:58:25 UTC (rev 999)
@@ -130,7 +130,7 @@
A different error code is returned for each type of failure:
- - C{1}: The Python interpreter version is < 2.3
+ - C{1}: The Python interpreter version is < 2.5
- C{2}: Error processing command-line arguments
- C{3}: Error configuring logging
- C{4}: Error parsing indicated configuration file
@@ -144,12 +144,12 @@
@return: Error code as described above.
"""
try:
- if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 3]:
- sys.stderr.write("Python version 2.3 or greater required.\n")
+ if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 5]:
+ sys.stderr.write("Python version 2.5 or greater required.\n")
return 1
except:
# sys.version_info isn't available before 2.0
- sys.stderr.write("Python version 2.3 or greater required.\n")
+ sys.stderr.write("Python version 2.5 or greater required.\n")
return 1
try:
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 19:56:08 UTC (rev 998)
+++ cedar-backup2/trunk/Changelog 2010-07-07 19:58:25 UTC (rev 999)
@@ -1,14 +1,15 @@
Version 2.20.0 unreleased
- * Make cback script more robust in the case of a bad interpreter version.
- * Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
- * Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls.
* Switch to minimum Python version of 2.5 (everyone should have it now).
+ - Make cback script more robust in the case of a bad interpreter version
- Change file headers, comments, manual, etc. to reference Python 2.5
- Convert to use @staticmethod rather than x = staticmethod(x)
+ - Change interpreter checks in test.py, cli.py and span.py
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
- Move unit tests into testcase folder to avoid test.py naming conflict
+ * Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
+ * Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls.
Version 2.19.6 22 May 2010
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2010-07-07 19:56:08 UTC (rev 998)
+++ cedar-backup2/trunk/util/test.py 2010-07-07 19:58:25 UTC (rev 999)
@@ -106,14 +106,14 @@
@return: Integer 0 upon success, integer 1 upon failure.
"""
- # Check the Python version. We require 2.3 or greater.
+ # Check the Python version. We require 2.5 or greater.
try:
- if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 3]:
- print "Python version 2.3 or greater required, sorry."
+ if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 5]:
+ print "Python version 2.5 or greater required, sorry."
return 1
except:
# sys.version_info isn't available before 2.0
- print "Python version 2.3 or greater required, sorry."
+ print "Python version 2.5 or greater required, sorry."
return 1
# Check for the correct CedarBackup2 location and import utilities
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 20:08:27
|
Revision: 997
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=997&view=rev
Author: pronovic
Date: 2010-07-07 19:34:11 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Convert to use @staticmethod
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/extend/capacity.py
cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
cedar-backup2/trunk/CedarBackup2/extend/mbox.py
cedar-backup2/trunk/CedarBackup2/extend/mysql.py
cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
cedar-backup2/trunk/CedarBackup2/extend/split.py
cedar-backup2/trunk/CedarBackup2/extend/subversion.py
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/util.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/doc/future/prune.py
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -546,6 +546,7 @@
_ActionSet._validateActions(actions, extensionNames)
self.actionSet = _ActionSet._buildActionSet(actions, actionMap)
+ @staticmethod
def _deriveExtensionNames(extensions):
"""
Builds a list of extended actions that are available in configuration.
@@ -557,8 +558,8 @@
for action in extensions.actions:
extensionNames.append(action.name)
return extensionNames
- _deriveExtensionNames = staticmethod(_deriveExtensionNames)
+ @staticmethod
def _buildHookMaps(hooks):
"""
Build two mappings from action name to configured C{ActionHook}.
@@ -574,8 +575,8 @@
elif hook.after:
postHookMap[hook.action] = hook
return (preHookMap, postHookMap)
- _buildHookMaps = staticmethod(_buildHookMaps)
+ @staticmethod
def _buildFunctionMap(extensions):
"""
Builds a mapping from named action to action function.
@@ -594,8 +595,8 @@
for action in extensions.actions:
functionMap[action.name] = getFunctionReference(action.module, action.function)
return functionMap
- _buildFunctionMap = staticmethod(_buildFunctionMap)
+ @staticmethod
def _buildIndexMap(extensions):
"""
Builds a mapping from action name to proper execution index.
@@ -681,8 +682,8 @@
logger.error("Extensions configuration is invalid (check for loops).")
raise ValueError("Unable to determine proper action order due to dependency recursion.")
return indexMap
- _buildIndexMap = staticmethod(_buildIndexMap)
+ @staticmethod
def _buildActionMap(managed, local, extensionNames, functionMap, indexMap, preHookMap, postHookMap, peerMap):
"""
Builds a mapping from action name to list of action items.
@@ -724,8 +725,8 @@
actionMap[name].append(_ManagedActionItem(index, name, peerMap[name]))
actionMap['all'] = actionMap['collect'] + actionMap['stage'] + actionMap['store'] + actionMap['purge']
return actionMap
- _buildActionMap = staticmethod(_buildActionMap)
+ @staticmethod
def _buildPeerMap(options, peers):
"""
Build a mapping from action name to list of remote peers.
@@ -756,8 +757,8 @@
else:
peerMap[managedAction] = [ remotePeer, ]
return peerMap
- _buildPeerMap = staticmethod(_buildPeerMap)
+ @staticmethod
def _deriveHooks(action, preHookDict, postHookDict):
"""
Derive pre- and post-action hooks, if any, associated with named action.
@@ -773,8 +774,8 @@
if postHookDict.has_key(action):
postHook = postHookDict[action]
return (preHook, postHook)
- _deriveHooks = staticmethod(_deriveHooks)
+ @staticmethod
def _validateActions(actions, extensionNames):
"""
Validate that the set of specified actions is sensible.
@@ -796,8 +797,8 @@
for action in NONCOMBINE_ACTIONS:
if action in actions and actions != [ action, ]:
raise ValueError("Action [%s] may not be combined with other actions." % action)
- _validateActions = staticmethod(_validateActions)
+ @staticmethod
def _buildActionSet(actions, actionMap):
"""
Build set of actions to be executed.
@@ -818,7 +819,6 @@
actionSet.extend(actionMap[action])
actionSet.sort() # sort the actions in order by index
return actionSet
- _buildActionSet = staticmethod(_buildActionSet)
def executeActions(self, configPath, options, config):
"""
@@ -839,6 +839,7 @@
for actionItem in self.actionSet:
actionItem.executeAction(configPath, options, config)
+ @staticmethod
def _getRemoteUser(options, remotePeer):
"""
Gets the remote user associated with a remote peer.
@@ -850,8 +851,8 @@
if remotePeer.remoteUser is None:
return options.backupUser
return remotePeer.remoteUser
- _getRemoteUser = staticmethod(_getRemoteUser)
+ @staticmethod
def _getRshCommand(options, remotePeer):
"""
Gets the RSH command associated with a remote peer.
@@ -863,8 +864,8 @@
if remotePeer.rshCommand is None:
return options.rshCommand
return remotePeer.rshCommand
- _getRshCommand = staticmethod(_getRshCommand)
+ @staticmethod
def _getCbackCommand(options, remotePeer):
"""
Gets the cback command associated with a remote peer.
@@ -876,8 +877,8 @@
if remotePeer.cbackCommand is None:
return options.cbackCommand
return remotePeer.cbackCommand
- _getCbackCommand = staticmethod(_getCbackCommand)
+ @staticmethod
def _getManagedActions(options, remotePeer):
"""
Gets the managed actions list associated with a remote peer.
@@ -889,7 +890,6 @@
if remotePeer.managedActions is None:
return options.managedActions
return remotePeer.managedActions
- _getManagedActions = staticmethod(_getManagedActions)
#######################################################################
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -4427,6 +4427,7 @@
self._store = Config._parseStore(parentNode)
self._purge = Config._parsePurge(parentNode)
+ @staticmethod
def _parseReference(parentNode):
"""
Parses a reference configuration section.
@@ -4452,8 +4453,8 @@
reference.description = readString(sectionNode, "description")
reference.generator = readString(sectionNode, "generator")
return reference
- _parseReference = staticmethod(_parseReference)
+ @staticmethod
def _parseExtensions(parentNode):
"""
Parses an extensions configuration section.
@@ -4484,8 +4485,8 @@
extensions.orderMode = readString(sectionNode, "order_mode")
extensions.actions = Config._parseExtendedActions(sectionNode)
return extensions
- _parseExtensions = staticmethod(_parseExtensions)
+ @staticmethod
def _parseOptions(parentNode):
"""
Parses a options configuration section.
@@ -4533,8 +4534,8 @@
managedActions = readString(sectionNode, "managed_actions")
options.managedActions = Config._parseCommaSeparatedString(managedActions)
return options
- _parseOptions = staticmethod(_parseOptions)
+ @staticmethod
def _parsePeers(parentNode):
"""
Parses a peers configuration section.
@@ -4558,8 +4559,8 @@
peers = PeersConfig()
(peers.localPeers, peers.remotePeers) = Config._parsePeerList(sectionNode)
return peers
- _parsePeers = staticmethod(_parsePeers)
+ @staticmethod
def _parseCollect(parentNode):
"""
Parses a collect configuration section.
@@ -4600,8 +4601,8 @@
collect.collectFiles = Config._parseCollectFiles(sectionNode)
collect.collectDirs = Config._parseCollectDirs(sectionNode)
return collect
- _parseCollect = staticmethod(_parseCollect)
+ @staticmethod
def _parseStage(parentNode):
"""
Parses a stage configuration section.
@@ -4630,8 +4631,8 @@
stage.targetDir = readString(sectionNode, "staging_dir")
(stage.localPeers, stage.remotePeers) = Config._parsePeerList(sectionNode)
return stage
- _parseStage = staticmethod(_parseStage)
+ @staticmethod
def _parseStore(parentNode):
"""
Parses a store configuration section.
@@ -4674,8 +4675,8 @@
store.blankBehavior = Config._parseBlankBehavior(sectionNode)
store.refreshMediaDelay = readInteger(sectionNode, "refresh_media_delay")
return store
- _parseStore = staticmethod(_parseStore)
+ @staticmethod
def _parsePurge(parentNode):
"""
Parses a purge configuration section.
@@ -4698,8 +4699,8 @@
purge = PurgeConfig()
purge.purgeDirs = Config._parsePurgeDirs(sectionNode)
return purge
- _parsePurge = staticmethod(_parsePurge)
+ @staticmethod
def _parseExtendedActions(parentNode):
"""
Reads extended actions data from immediately beneath the parent.
@@ -4732,8 +4733,8 @@
if lst == []:
lst = None
return lst
- _parseExtendedActions = staticmethod(_parseExtendedActions)
+ @staticmethod
def _parseExclusions(parentNode):
"""
Reads exclusions data from immediately beneath the parent.
@@ -4763,8 +4764,8 @@
relative = readStringList(sectionNode, "rel_path")
patterns = readStringList(sectionNode, "pattern")
return (absolute, relative, patterns)
- _parseExclusions = staticmethod(_parseExclusions)
+ @staticmethod
def _parseOverrides(parentNode):
"""
Reads a list of C{CommandOverride} objects from immediately beneath the parent.
@@ -4789,8 +4790,8 @@
if lst == []:
lst = None
return lst
- _parseOverrides = staticmethod(_parseOverrides)
+ @staticmethod
def _parseHooks(parentNode):
"""
Reads a list of C{ActionHook} objects from immediately beneath the parent.
@@ -4821,8 +4822,8 @@
if lst == []:
lst = None
return lst
- _parseHooks = staticmethod(_parseHooks)
+ @staticmethod
def _parseCollectFiles(parentNode):
"""
Reads a list of C{CollectFile} objects from immediately beneath the parent.
@@ -4856,8 +4857,8 @@
if lst == []:
lst = None
return lst
- _parseCollectFiles = staticmethod(_parseCollectFiles)
+ @staticmethod
def _parseCollectDirs(parentNode):
"""
Reads a list of C{CollectDir} objects from immediately beneath the parent.
@@ -4907,8 +4908,8 @@
if lst == []:
lst = None
return lst
- _parseCollectDirs = staticmethod(_parseCollectDirs)
+ @staticmethod
def _parsePurgeDirs(parentNode):
"""
Reads a list of C{PurgeDir} objects from immediately beneath the parent.
@@ -4933,8 +4934,8 @@
if lst == []:
lst = None
return lst
- _parsePurgeDirs = staticmethod(_parsePurgeDirs)
+ @staticmethod
def _parsePeerList(parentNode):
"""
Reads remote and local peer data from immediately beneath the parent.
@@ -4996,8 +4997,8 @@
if remotePeers == []:
remotePeers = None
return (localPeers, remotePeers)
- _parsePeerList = staticmethod(_parsePeerList)
+ @staticmethod
def _parseDependencies(parentNode):
"""
Reads extended action dependency information from a parent node.
@@ -5029,8 +5030,8 @@
beforeList = Config._parseCommaSeparatedString(runBefore)
afterList = Config._parseCommaSeparatedString(runAfter)
return ActionDependencies(beforeList, afterList)
- _parseDependencies = staticmethod(_parseDependencies)
+ @staticmethod
def _parseCommaSeparatedString(commaString):
"""
Parses a list of values out of a comma-separated string.
@@ -5052,8 +5053,8 @@
if len(item) > 0:
pass2.append(item)
return pass2
- _parseCommaSeparatedString = staticmethod(_parseCommaSeparatedString)
+ @staticmethod
def _parseBlankBehavior(parentNode):
"""
Reads a single C{BlankBehavior} object from immediately beneath the parent.
@@ -5075,7 +5076,6 @@
blankBehavior.blankMode = readString(sectionNode, "mode")
blankBehavior.blankFactor = readString(sectionNode, "factor")
return blankBehavior
- _parseBlankBehavior = staticmethod(_parseBlankBehavior)
########################################
@@ -5108,6 +5108,7 @@
xmlDom.unlink()
return xmlData
+ @staticmethod
def _addReference(xmlDom, parentNode, referenceConfig):
"""
Adds a <reference> configuration section as the next child of a parent.
@@ -5131,8 +5132,8 @@
addStringNode(xmlDom, sectionNode, "revision", referenceConfig.revision)
addStringNode(xmlDom, sectionNode, "description", referenceConfig.description)
addStringNode(xmlDom, sectionNode, "generator", referenceConfig.generator)
- _addReference = staticmethod(_addReference)
+ @staticmethod
def _addExtensions(xmlDom, parentNode, extensionsConfig):
"""
Adds an <extensions> configuration section as the next child of a parent.
@@ -5159,8 +5160,8 @@
if extensionsConfig.actions is not None:
for action in extensionsConfig.actions:
Config._addExtendedAction(xmlDom, sectionNode, action)
- _addExtensions = staticmethod(_addExtensions)
+ @staticmethod
def _addOptions(xmlDom, parentNode, optionsConfig):
"""
Adds a <options> configuration section as the next child of a parent.
@@ -5209,8 +5210,8 @@
if optionsConfig.hooks is not None:
for hook in optionsConfig.hooks:
Config._addHook(xmlDom, sectionNode, hook)
- _addOptions = staticmethod(_addOptions)
+ @staticmethod
def _addPeers(xmlDom, parentNode, peersConfig):
"""
Adds a <peers> configuration section as the next child of a parent.
@@ -5238,8 +5239,8 @@
if peersConfig.remotePeers is not None:
for remotePeer in peersConfig.remotePeers:
Config._addRemotePeer(xmlDom, sectionNode, remotePeer)
- _addPeers = staticmethod(_addPeers)
+ @staticmethod
def _addCollect(xmlDom, parentNode, collectConfig):
"""
Adds a <collect> configuration section as the next child of a parent.
@@ -5289,8 +5290,8 @@
if collectConfig.collectDirs is not None:
for collectDir in collectConfig.collectDirs:
Config._addCollectDir(xmlDom, sectionNode, collectDir)
- _addCollect = staticmethod(_addCollect)
+ @staticmethod
def _addStage(xmlDom, parentNode, stageConfig):
"""
Adds a <stage> configuration section as the next child of a parent.
@@ -5323,8 +5324,8 @@
if stageConfig.remotePeers is not None:
for remotePeer in stageConfig.remotePeers:
Config._addRemotePeer(xmlDom, sectionNode, remotePeer)
- _addStage = staticmethod(_addStage)
+ @staticmethod
def _addStore(xmlDom, parentNode, storeConfig):
"""
Adds a <store> configuration section as the next child of a parent.
@@ -5365,8 +5366,8 @@
addBooleanNode(xmlDom, sectionNode, "no_eject", storeConfig.noEject)
addIntegerNode(xmlDom, sectionNode, "refresh_media_delay", storeConfig.refreshMediaDelay)
Config._addBlankBehavior(xmlDom, sectionNode, storeConfig.blankBehavior)
- _addStore = staticmethod(_addStore)
+ @staticmethod
def _addPurge(xmlDom, parentNode, purgeConfig):
"""
Adds a <purge> configuration section as the next child of a parent.
@@ -5388,8 +5389,8 @@
if purgeConfig.purgeDirs is not None:
for purgeDir in purgeConfig.purgeDirs:
Config._addPurgeDir(xmlDom, sectionNode, purgeDir)
- _addPurge = staticmethod(_addPurge)
+ @staticmethod
def _addExtendedAction(xmlDom, parentNode, action):
"""
Adds an extended action container as the next child of a parent.
@@ -5421,8 +5422,8 @@
addStringNode(xmlDom, sectionNode, "function", action.function)
addIntegerNode(xmlDom, sectionNode, "index", action.index)
Config._addDependencies(xmlDom, sectionNode, action.dependencies)
- _addExtendedAction = staticmethod(_addExtendedAction)
+ @staticmethod
def _addOverride(xmlDom, parentNode, override):
"""
Adds a command override container as the next child of a parent.
@@ -5446,8 +5447,8 @@
sectionNode = addContainerNode(xmlDom, parentNode, "override")
addStringNode(xmlDom, sectionNode, "command", override.command)
addStringNode(xmlDom, sectionNode, "abs_path", override.absolutePath)
- _addOverride = staticmethod(_addOverride)
+ @staticmethod
def _addHook(xmlDom, parentNode, hook):
"""
Adds an action hook container as the next child of a parent.
@@ -5482,8 +5483,8 @@
sectionNode = addContainerNode(xmlDom, parentNode, "post_action_hook")
addStringNode(xmlDom, sectionNode, "action", hook.action)
addStringNode(xmlDom, sectionNode, "command", hook.command)
- _addHook = staticmethod(_addHook)
+ @staticmethod
def _addCollectFile(xmlDom, parentNode, collectFile):
"""
Adds a collect file container as the next child of a parent.
@@ -5512,8 +5513,8 @@
addStringNode(xmlDom, sectionNode, "abs_path", collectFile.absolutePath)
addStringNode(xmlDom, sectionNode, "collect_mode", collectFile.collectMode)
addStringNode(xmlDom, sectionNode, "archive_mode", collectFile.archiveMode)
- _addCollectFile = staticmethod(_addCollectFile)
+ @staticmethod
def _addCollectDir(xmlDom, parentNode, collectDir):
"""
Adds a collect directory container as the next child of a parent.
@@ -5568,8 +5569,8 @@
if collectDir.excludePatterns is not None:
for pattern in collectDir.excludePatterns:
addStringNode(xmlDom, excludeNode, "pattern", pattern)
- _addCollectDir = staticmethod(_addCollectDir)
+ @staticmethod
def _addLocalPeer(xmlDom, parentNode, localPeer):
"""
Adds a local peer container as the next child of a parent.
@@ -5599,8 +5600,8 @@
addStringNode(xmlDom, sectionNode, "type", "local")
addStringNode(xmlDom, sectionNode, "collect_dir", localPeer.collectDir)
addStringNode(xmlDom, sectionNode, "ignore_failures", localPeer.ignoreFailureMode)
- _addLocalPeer = staticmethod(_addLocalPeer)
+ @staticmethod
def _addRemotePeer(xmlDom, parentNode, remotePeer):
"""
Adds a remote peer container as the next child of a parent.
@@ -5644,8 +5645,8 @@
addBooleanNode(xmlDom, sectionNode, "managed", remotePeer.managed)
managedActions = Config._buildCommaSeparatedString(remotePeer.managedActions)
addStringNode(xmlDom, sectionNode, "managed_actions", managedActions)
- _addRemotePeer = staticmethod(_addRemotePeer)
+ @staticmethod
def _addPurgeDir(xmlDom, parentNode, purgeDir):
"""
Adds a purge directory container as the next child of a parent.
@@ -5669,8 +5670,8 @@
sectionNode = addContainerNode(xmlDom, parentNode, "dir")
addStringNode(xmlDom, sectionNode, "abs_path", purgeDir.absolutePath)
addIntegerNode(xmlDom, sectionNode, "retain_days", purgeDir.retainDays)
- _addPurgeDir = staticmethod(_addPurgeDir)
+ @staticmethod
def _addDependencies(xmlDom, parentNode, dependencies):
"""
Adds a extended action dependencies to parent node.
@@ -5692,8 +5693,8 @@
runAfter = Config._buildCommaSeparatedString(dependencies.afterList)
addStringNode(xmlDom, sectionNode, "run_before", runBefore)
addStringNode(xmlDom, sectionNode, "run_after", runAfter)
- _addDependencies = staticmethod(_addDependencies)
+ @staticmethod
def _buildCommaSeparatedString(valueList):
"""
Creates a comma-separated string from a list of values.
@@ -5708,8 +5709,8 @@
if valueList is None:
return None
return ",".join(valueList)
- _buildCommaSeparatedString = staticmethod(_buildCommaSeparatedString)
+ @staticmethod
def _addBlankBehavior(xmlDom, parentNode, blankBehavior):
"""
Adds a blanking behavior container as the next child of a parent.
@@ -5732,7 +5733,6 @@
sectionNode = addContainerNode(xmlDom, parentNode, "blank_behavior")
addStringNode(xmlDom, sectionNode, "mode", blankBehavior.blankMode)
addStringNode(xmlDom, sectionNode, "factor", blankBehavior.blankFactor)
- _addBlankBehavior = staticmethod(_addBlankBehavior)
#################################################
@@ -6018,6 +6018,7 @@
# Utility methods used for validating content
##############################################
+ @staticmethod
def _checkUnique(prefix, values):
"""
Checks that all values are unique.
@@ -6038,7 +6039,6 @@
duplicates.append(values[i])
if duplicates:
raise ValueError("%s %s" % (prefix, duplicates))
- _checkUnique = staticmethod(_checkUnique)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/capacity.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -435,6 +435,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._capacity = LocalConfig._parseCapacity(parentNode)
+ @staticmethod
def _parseCapacity(parentNode):
"""
Parses a capacity configuration section.
@@ -456,8 +457,8 @@
capacity.maxPercentage = LocalConfig._readPercentageQuantity(section, "max_percentage")
capacity.minBytes = readByteQuantity(section, "min_bytes")
return capacity
- _parseCapacity = staticmethod(_parseCapacity)
+ @staticmethod
def _readPercentageQuantity(parent, name):
"""
Read a percentage quantity value from an XML document.
@@ -469,8 +470,8 @@
if quantity is None:
return None
return PercentageQuantity(quantity)
- _readPercentageQuantity = staticmethod(_readPercentageQuantity)
+ @staticmethod
def _addPercentageQuantity(xmlDom, parentNode, nodeName, percentageQuantity):
"""
Adds a text node as the next child of a parent, to contain a percentage quantity.
@@ -486,7 +487,6 @@
"""
if percentageQuantity is not None:
addStringNode(xmlDom, parentNode, nodeName, percentageQuantity.quantity)
- _addPercentageQuantity = staticmethod(_addPercentageQuantity)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -350,6 +350,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._encrypt = LocalConfig._parseEncrypt(parentNode)
+ @staticmethod
def _parseEncrypt(parent):
"""
Parses an encrypt configuration section.
@@ -371,7 +372,6 @@
encrypt.encryptMode = readString(section, "encrypt_mode")
encrypt.encryptTarget = readString(section, "encrypt_target")
return encrypt
- _parseEncrypt = staticmethod(_parseEncrypt)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/mbox.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -833,6 +833,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._mbox = LocalConfig._parseMbox(parentNode)
+ @staticmethod
def _parseMbox(parent):
"""
Parses an mbox configuration section.
@@ -865,8 +866,8 @@
mbox.mboxFiles = LocalConfig._parseMboxFiles(section)
mbox.mboxDirs = LocalConfig._parseMboxDirs(section)
return mbox
- _parseMbox = staticmethod(_parseMbox)
+ @staticmethod
def _parseMboxFiles(parent):
"""
Reads a list of C{MboxFile} objects from immediately beneath the parent.
@@ -893,8 +894,8 @@
if lst == []:
lst = None
return lst
- _parseMboxFiles = staticmethod(_parseMboxFiles)
+ @staticmethod
def _parseMboxDirs(parent):
"""
Reads a list of C{MboxDir} objects from immediately beneath the parent.
@@ -930,8 +931,8 @@
if lst == []:
lst = None
return lst
- _parseMboxDirs = staticmethod(_parseMboxDirs)
+ @staticmethod
def _parseExclusions(parentNode):
"""
Reads exclusions data from immediately beneath the parent.
@@ -955,8 +956,8 @@
relative = readStringList(section, "rel_path")
patterns = readStringList(section, "pattern")
return (relative, patterns)
- _parseExclusions = staticmethod(_parseExclusions)
+ @staticmethod
def _addMboxFile(xmlDom, parentNode, mboxFile):
"""
Adds an mbox file container as the next child of a parent.
@@ -982,8 +983,8 @@
addStringNode(xmlDom, sectionNode, "abs_path", mboxFile.absolutePath)
addStringNode(xmlDom, sectionNode, "collect_mode", mboxFile.collectMode)
addStringNode(xmlDom, sectionNode, "compress_mode", mboxFile.compressMode)
- _addMboxFile = staticmethod(_addMboxFile)
+ @staticmethod
def _addMboxDir(xmlDom, parentNode, mboxDir):
"""
Adds an mbox directory container as the next child of a parent.
@@ -1023,7 +1024,6 @@
if mboxDir.excludePatterns is not None:
for pattern in mboxDir.excludePatterns:
addStringNode(xmlDom, excludeNode, "pattern", pattern)
- _addMboxDir = staticmethod(_addMboxDir)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/mysql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -479,6 +479,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._mysql = LocalConfig._parseMysql(parentNode)
+ @staticmethod
def _parseMysql(parentNode):
"""
Parses a mysql configuration section.
@@ -510,7 +511,6 @@
mysql.all = readBoolean(section, "all")
mysql.databases = readStringList(section, "database")
return mysql
- _parseMysql = staticmethod(_parseMysql)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -444,6 +444,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._postgresql = LocalConfig._parsePostgresql(parentNode)
+ @staticmethod
def _parsePostgresql(parent):
"""
Parses a postgresql configuration section.
@@ -473,7 +474,6 @@
postgresql.all = readBoolean(section, "all")
postgresql.databases = readStringList(section, "database")
return postgresql
- _parsePostgresql = staticmethod(_parsePostgresql)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/split.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -358,6 +358,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._split = LocalConfig._parseSplit(parentNode)
+ @staticmethod
def _parseSplit(parent):
"""
Parses an split configuration section.
@@ -379,7 +380,6 @@
split.sizeLimit = readByteQuantity(section, "size_limit")
split.splitSize = readByteQuantity(section, "split_size")
return split
- _parseSplit = staticmethod(_parseSplit)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/extend/subversion.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -852,6 +852,7 @@
(xmlDom, parentNode) = createInputDom(xmlData)
self._subversion = LocalConfig._parseSubversion(parentNode)
+ @staticmethod
def _parseSubversion(parent):
"""
Parses a subversion configuration section.
@@ -884,8 ...
[truncated message content] |
|
From: <pro...@us...> - 2010-07-07 20:17:15
|
Revision: 1000
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1000&view=rev
Author: pronovic
Date: 2010-07-07 20:17:08 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Remove Python 2.3-compatible versions of util.nullDevice() and util.Pipe
Modified Paths:
--------------
cedar-backup2/trunk/CREDITS
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CREDITS
===================================================================
--- cedar-backup2/trunk/CREDITS 2010-07-07 19:58:25 UTC (rev 999)
+++ cedar-backup2/trunk/CREDITS 2010-07-07 20:17:08 UTC (rev 1000)
@@ -41,8 +41,8 @@
Source code annotated as "(c) 2001, 2002 Python Software Foundation" was
originally taken from or derived from code within the Python 2.3 codebase.
This code was released under the Python 2.3 license, which is an MIT-style
-academic license. Items under this license include the util.Pipe
-implementation based on popen2.Popen4.
+academic license. Items under this license include the function
+util.getFunctionReference().
Source code annotated as "(c) 2000-2004 CollabNet" was originally released
under the CollabNet License, which is an Apache/BSD-style license. Items
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 19:58:25 UTC (rev 999)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:17:08 UTC (rev 1000)
@@ -84,6 +84,7 @@
import time
import logging
import string # pylint: disable-msg=W0402
+from subprocess import Popen, STDOUT, PIPE
from CedarBackup2.release import VERSION, DATE
@@ -94,17 +95,7 @@
except ImportError:
_UID_GID_AVAILABLE = False
-try:
- from subprocess import Popen
- _PIPE_IMPLEMENTATION = "subprocess.Popen"
-except ImportError:
- try:
- from popen2 import Popen4
- _PIPE_IMPLEMENTATION = "popen2.Popen4"
- except ImportError:
- raise ImportError("Unable to import either subprocess.Popen or popen2.Popen4 for use by Pipe class.")
-
########################################################################
# Module-wide constants and variables
########################################################################
@@ -855,101 +846,30 @@
# Pipe class definition
########################################################################
-if _PIPE_IMPLEMENTATION == "subprocess.Popen":
+class Pipe(Popen):
+ """
+ Specialized pipe class for use by C{executeCommand}.
- from subprocess import STDOUT, PIPE
+ The L{executeCommand} function needs a specialized way of interacting
+ with a pipe. First, C{executeCommand} only reads from the pipe, and
+ never writes to it. Second, C{executeCommand} needs a way to discard all
+ output written to C{stderr}, as a means of simulating the shell
+ C{2>/dev/null} construct.
- class Pipe(Popen):
- """
- Specialized pipe class for use by C{executeCommand}.
+ All of this functionality is provided (in Python 2.4 or later) by the
+ C{subprocess.Popen} class, so when that class is available, we'll use it.
+ Otherwise, there's another implementation based on C{popen2.Popen4},
+ which unfortunately only works on UNIX platforms.
+ """
+ def __init__(self, cmd, bufsize=-1, ignoreStderr=False):
+ stderr = STDOUT
+ if ignoreStderr:
+ devnull = nullDevice()
+ stderr = os.open(devnull, os.O_RDWR)
+ Popen.__init__(self, shell=False, args=cmd, bufsize=bufsize, stdin=None, stdout=PIPE, stderr=stderr)
+ self.fromchild = self.stdout # for compatibility with original interface based on popen2.Popen4
- The L{executeCommand} function needs a specialized way of interacting
- with a pipe. First, C{executeCommand} only reads from the pipe, and
- never writes to it. Second, C{executeCommand} needs a way to discard all
- output written to C{stderr}, as a means of simulating the shell
- C{2>/dev/null} construct.
- All of this functionality is provided (in Python 2.4 or later) by the
- C{subprocess.Popen} class, so when that class is available, we'll use it.
- Otherwise, there's another implementation based on C{popen2.Popen4},
- which unfortunately only works on UNIX platforms.
- """
- def __init__(self, cmd, bufsize=-1, ignoreStderr=False):
- stderr = STDOUT
- if ignoreStderr:
- devnull = nullDevice()
- stderr = os.open(devnull, os.O_RDWR)
- Popen.__init__(self, shell=False, args=cmd, bufsize=bufsize, stdin=None, stdout=PIPE, stderr=stderr)
- self.fromchild = self.stdout # for compatibility with original interface based on popen2.Popen4
-
-else: # _PIPE_IMPLEMENTATION == "popen2.Popen4"
-
- from popen2 import _cleanup, _active
-
- class Pipe(Popen4):
- """
- Specialized pipe class for use by C{executeCommand}.
-
- The L{executeCommand} function needs a specialized way of interacting with a
- pipe that isn't satisfied by the standard C{Popen3} and C{Popen4} classes in
- C{popen2}. First, C{executeCommand} only reads from the pipe, and never
- writes to it. Second, C{executeCommand} needs a way to discard all output
- written to C{stderr}, as a means of simulating the shell C{2>/dev/null}
- construct.
-
- This class inherits from C{Popen4}. If the C{ignoreStderr} flag is passed in
- as C{False}, then the standard C{Popen4} constructor will be called and
- C{stdout} and C{stderr} will be intermingled in the output.
-
- Otherwise, we'll call a custom version of the constructor which was
- basically stolen from the real constructor in C{python2.3/Lib/popen2.py}.
- This custom constructor will redirect the C{stderr} file descriptor to
- C{/dev/null}. I've done this based on a suggestion from Donn Cave on
- comp.lang.python.
-
- In either case, the C{tochild} file object is always closed before returning
- from the constructor, since it is never needed by C{executeCommand}.
-
- I really wish there were a prettier way to do this. Unfortunately, I
- need access to the guts of the constructor implementation because of the
- way the pipe process is forked, etc. It doesn't work to just call the
- superclass constructor and then modify a few things afterwards. Even
- worse, I have to access private C{popen2} module members C{_cleanup} and
- C{_active} in order to duplicate the implementation.
-
- Hopefully this whole thing will continue to work properly. At least we
- can use the other L{subprocess.Popen}-based implementation when that
- class is available.
-
- @copyright: Some of this code, prior to customization, was originally part
- of the Python 2.3 codebase. Python code is copyright (c) 2001, 2002 Python
- Software Foundation; All Rights Reserved.
- """
-
- def __init__(self, cmd, bufsize=-1, ignoreStderr=False):
- if not ignoreStderr:
- Popen4.__init__(self, cmd, bufsize)
- else:
- _cleanup()
- p2cread, p2cwrite = os.pipe()
- c2pread, c2pwrite = os.pipe()
- self.pid = os.fork()
- if self.pid == 0: # Child
- os.dup2(p2cread, 0)
- os.dup2(c2pwrite, 1)
- devnull = nullDevice()
- null = os.open(devnull, os.O_RDWR)
- os.dup2(null, 2)
- os.close(null)
- self._run_child(cmd)
- os.close(p2cread)
- self.tochild = os.fdopen(p2cwrite, 'w', bufsize)
- os.close(c2pwrite)
- self.fromchild = os.fdopen(c2pread, 'r', bufsize)
- _active.append(self)
- self.tochild.close() # we'll never write to it, and this way we don't confuse anything.
-
-
########################################################################
# Diagnostics class definition
########################################################################
@@ -1863,20 +1783,8 @@
The null device is something like C{/dev/null} on a UNIX system. The name
varies on other platforms.
-
- In Python 2.4 and better, we can use C{os.devnull}. Since we want to be
- portable to python 2.3, getting the value in earlier versions of Python
- takes some screwing around. Basically, this function will only work on
- either UNIX-like systems (the default) or Windows.
"""
- try:
- return os.devnull
- except AttributeError:
- import platform
- if platform.platform().startswith("Windows"):
- return "NUL"
- else:
- return "/dev/null"
+ return os.devnull
##############################
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 19:58:25 UTC (rev 999)
+++ cedar-backup2/trunk/Changelog 2010-07-07 20:17:08 UTC (rev 1000)
@@ -5,6 +5,7 @@
- Change file headers, comments, manual, etc. to reference Python 2.5
- Convert to use @staticmethod rather than x = staticmethod(x)
- Change interpreter checks in test.py, cli.py and span.py
+ - Remove Python 2.3-compatible versions of util.nullDevice() and util.Pipe
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
- Move unit tests into testcase folder to avoid test.py naming conflict
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-07 19:58:25 UTC (rev 999)
+++ cedar-backup2/trunk/TODO 2010-07-07 20:17:08 UTC (rev 1000)
@@ -34,9 +34,6 @@
============================
-Move to Python 2.5 -- is available in etch
-Move to decorators for things like staticmethod (more readable)
-Change all checks to match new version -- maybe list required version in release file or something?
New images for manual (something I have given up on several times)
Remove action.py
Use decorator in places like cli._usage() rather than passing in file descriptor?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 20:20:23
|
Revision: 1001
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1001&view=rev
Author: pronovic
Date: 2010-07-07 20:20:16 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Remove configuration boilerplate "As with all of the ... are optional..."
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 20:17:08 UTC (rev 1000)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 20:20:16 UTC (rev 1001)
@@ -420,12 +420,6 @@
dependencies in terms of other named actions. This class encapsulates the dependency
information for an extended action.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- Any action name must be a non-empty string matching C{ACTION_NAME_REGEX}
@@ -541,12 +535,6 @@
A hook associated with an action is a shell command to be executed either
before or after a named action is executed.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The action name must be a non-empty string matching C{ACTION_NAME_REGEX}
@@ -680,12 +668,6 @@
before or after a named action is executed. In this case, a pre-action hook
is executed before the named action.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The action name must be a non-empty string consisting of lower-case letters and digits.
@@ -724,12 +706,6 @@
before or after a named action is executed. In this case, a post-action hook
is executed after the named action.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The action name must be a non-empty string consisting of lower-case letters and digits.
@@ -769,12 +745,6 @@
"""
Class representing optimized store-action media blanking behavior.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The blanking mode must be a one of the values in L{VALID_BLANK_MODES}
@@ -881,12 +851,6 @@
"""
Class representing an extended action.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
Essentially, an extended action needs to allow the following to happen::
exec("from %s import %s" % (module, function))
@@ -1094,12 +1058,6 @@
"""
Class representing a piece of Cedar Backup command override configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The absolute path must be absolute
@@ -1204,12 +1162,6 @@
"""
Class representing a Cedar Backup collect file.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- Absolute paths must be absolute
@@ -1340,12 +1292,6 @@
"""
Class representing a Cedar Backup collect directory.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- Absolute paths must be absolute
@@ -1670,12 +1616,6 @@
"""
Class representing a Cedar Backup purge directory.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The absolute path must be an absolute path
@@ -1785,12 +1725,6 @@
"""
Class representing a Cedar Backup peer.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The peer name must be a non-empty string.
@@ -1921,12 +1855,6 @@
"""
Class representing a Cedar Backup peer.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The peer name must be a non-empty string.
@@ -2230,12 +2158,6 @@
configuration and exists mostly for backwards-compatibility with Cedar
Backup 1.x.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. We don't do any
- validation on the contents of any of the fields, although we generally
- expect them to be strings.
-
@sort: __init__, __repr__, __str__, __cmp__, author, revision, description, generator
"""
@@ -2373,12 +2295,6 @@
configuration to map a command-line Cedar Backup action (i.e. "database")
to their function.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- If set, the order mode must be one of the values in C{VALID_ORDER_MODES}
@@ -2485,12 +2401,6 @@
The options section is used to store global configuration options and
defaults that can be applied to other sections.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The working directory must be an absolute path.
@@ -2877,10 +2787,6 @@
configured, then peers may be managed or unmanaged, and the stage section
peer configuration (if any) completely overrides this configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in.
-
The following restrictions exist on data in this class:
- The list of local peers must contain only C{LocalPeer} objects
@@ -3005,12 +2911,6 @@
"""
Class representing a Cedar Backup collect configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The target directory must be an absolute path.
@@ -3316,12 +3216,6 @@
"""
Class representing a Cedar Backup stage configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The target directory must be an absolute path
@@ -3475,12 +3369,6 @@
"""
Class representing a Cedar Backup store configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The source directory must be an absolute path.
@@ -3869,12 +3757,6 @@
"""
Class representing a Cedar Backup purge configuration.
- As with all of the other classes that represent configuration sections, all
- of these values are optional. It is up to some higher-level construct to
- decide whether everything they need is filled in. Some validation is done
- on non-C{None} assignments through the use of the Python C{property()}
- construct.
-
The following restrictions exist on data in this class:
- The purge directory list must be a list of C{PurgeDir} objects.
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 20:17:08 UTC (rev 1000)
+++ cedar-backup2/trunk/Changelog 2010-07-07 20:20:16 UTC (rev 1001)
@@ -11,6 +11,7 @@
- Move unit tests into testcase folder to avoid test.py naming conflict
* Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
* Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls.
+ * Remove configuration boilerplate "As with all of the ... are optional..."
Version 2.19.6 22 May 2010
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-07 20:17:08 UTC (rev 1000)
+++ cedar-backup2/trunk/TODO 2010-07-07 20:20:16 UTC (rev 1001)
@@ -75,7 +75,6 @@
- List versions of other fancy checks (i.e. abs path or whatever)
- Might not really be worth it (really worth sacrificing "local" readability?)
- Maybe some of this (and __cmp___) could be done with a superclass?
-Remove configuration boilerplate "As with all of the ... are optional..."
If each extension really has its own Config object (?) pull out common parsing code
Config code is generally readable, might not be worth abstracting it
- Not sure that comments are worth it -- they're longer than the method body
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 20:23:06
|
Revision: 1002
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1002&view=rev
Author: pronovic
Date: 2010-07-07 20:23:00 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Remove Python 2.3-compatible versions of util.nullDevice() and util.Pipe
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:20:16 UTC (rev 1001)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:23:00 UTC (rev 1002)
@@ -855,11 +855,6 @@
never writes to it. Second, C{executeCommand} needs a way to discard all
output written to C{stderr}, as a means of simulating the shell
C{2>/dev/null} construct.
-
- All of this functionality is provided (in Python 2.4 or later) by the
- C{subprocess.Popen} class, so when that class is available, we'll use it.
- Otherwise, there's another implementation based on C{popen2.Popen4},
- which unfortunately only works on UNIX platforms.
"""
def __init__(self, cmd, bufsize=-1, ignoreStderr=False):
stderr = STDOUT
@@ -867,7 +862,6 @@
devnull = nullDevice()
stderr = os.open(devnull, os.O_RDWR)
Popen.__init__(self, shell=False, args=cmd, bufsize=bufsize, stdin=None, stdout=PIPE, stderr=stderr)
- self.fromchild = self.stdout # for compatibility with original interface based on popen2.Popen4
########################################################################
@@ -1485,7 +1479,7 @@
# The problem appears to be that we sometimes get a bad stderr file descriptor.
pipe = Pipe(fields, ignoreStderr=ignoreStderr)
while True:
- line = pipe.fromchild.readline()
+ line = pipe.stdout.readline()
if not line: break
if returnOutput: output.append(line)
if outputFile is not None: outputFile.write(line)
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-07 20:20:16 UTC (rev 1001)
+++ cedar-backup2/trunk/TODO 2010-07-07 20:23:00 UTC (rev 1002)
@@ -98,9 +98,6 @@
- or maybe we have a flag (or several different parent classes) that control this behavior?
isn't buildPath() redundant -- doesn't os.path.join() do this?
what about captureOutput() -- can this kind of thing be done with a decorator now?
-implement Pipe only in terms of subprocess.Popen (get rid of popen2.Popen4-based implementation)
- - might be able to remove self.fromchild attribute (there for backwards compatibility)
-get rid of nullDevice(), since Python 2.5 should have os.devnull
remove writer.py
prune IsoImage and CdWriter to include only methods and attributes that we actually use
Pull out common functionality like openTray() and closeTray() somehow?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 20:48:52
|
Revision: 1003
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1003&view=rev
Author: pronovic
Date: 2010-07-07 20:48:46 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Refactor checkUnique() and parseCommaSeparatedString() from config to util.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 20:23:00 UTC (rev 1002)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-07-07 20:48:46 UTC (rev 1003)
@@ -244,8 +244,8 @@
# Cedar Backup modules
from CedarBackup2.writers.util import validateScsiId, validateDriveSpeed
-from CedarBackup2.util import UnorderedList, AbsolutePathList, ObjectTypeList
-from CedarBackup2.util import RegexMatchList, RegexList, encodePath
+from CedarBackup2.util import UnorderedList, AbsolutePathList, ObjectTypeList, parseCommaSeparatedString
+from CedarBackup2.util import RegexMatchList, RegexList, encodePath, checkUnique
from CedarBackup2.util import convertSize, UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES
from CedarBackup2.xmlutil import isElement, readChildren, readFirstChild
from CedarBackup2.xmlutil import readStringList, readString, readInteger, readBoolean
@@ -4414,7 +4414,7 @@
options.overrides = Config._parseOverrides(sectionNode)
options.hooks = Config._parseHooks(sectionNode)
managedActions = readString(sectionNode, "managed_actions")
- options.managedActions = Config._parseCommaSeparatedString(managedActions)
+ options.managedActions = parseCommaSeparatedString(managedActions)
return options
@staticmethod
@@ -4872,7 +4872,7 @@
remotePeer.ignoreFailureMode = readString(entry, "ignore_failures")
remotePeer.managed = readBoolean(entry, "managed")
managedActions = readString(entry, "managed_actions")
- remotePeer.managedActions = Config._parseCommaSeparatedString(managedActions)
+ remotePeer.managedActions = parseCommaSeparatedString(managedActions)
remotePeers.append(remotePeer)
if localPeers == []:
localPeers = None
@@ -4909,34 +4909,11 @@
else:
runBefore = readString(sectionNode, "run_before")
runAfter = readString(sectionNode, "run_after")
- beforeList = Config._parseCommaSeparatedString(runBefore)
- afterList = Config._parseCommaSeparatedString(runAfter)
+ beforeList = parseCommaSeparatedString(runBefore)
+ afterList = parseCommaSeparatedString(runAfter)
return ActionDependencies(beforeList, afterList)
@staticmethod
- def _parseCommaSeparatedString(commaString):
- """
- Parses a list of values out of a comma-separated string.
-
- The items in the list are split by comma, and then have whitespace
- stripped. As a special case, if C{commaString} is C{None}, then C{None}
- will be returned.
-
- @param commaString: List of values in comma-separated string format.
- @return: Values from commaString split into a list, or C{None}.
- """
- if commaString is None:
- return None
- else:
- pass1 = commaString.split(",")
- pass2 = []
- for item in pass1:
- item = item.strip()
- if len(item) > 0:
- pass2.append(item)
- return pass2
-
- @staticmethod
def _parseBlankBehavior(parentNode):
"""
Reads a single C{BlankBehavior} object from immediately beneath the parent.
@@ -5680,7 +5657,7 @@
elif self.extensions.orderMode == "dependency":
if action.dependencies is None:
raise ValueError("Each extended action must set dependency information, based on order mode.")
- Config._checkUnique("Duplicate extension names exist:", names)
+ checkUnique("Duplicate extension names exist:", names)
def _validateOptions(self):
"""
@@ -5893,36 +5870,9 @@
if ((self.options is None or self.options.managedActions is None or len(self.options.managedActions) < 1)
and (remotePeer.managedActions is None or len(remotePeer.managedActions) < 1)):
raise ValueError("Managed actions list must be set in options section or individual remote peer.")
- Config._checkUnique("Duplicate peer names exist:", names)
+ checkUnique("Duplicate peer names exist:", names)
- ##############################################
- # Utility methods used for validating content
- ##############################################
-
- @staticmethod
- def _checkUnique(prefix, values):
- """
- Checks that all values are unique.
-
- The values list is checked for duplicate values. If there are
- duplicates, an exception is thrown. All duplicate values are listed in
- the exception.
-
- @param prefix: Prefix to use in the thrown exception
- @param values: List of values to check
-
- @raise ValueError: If there are duplicates in the list
- """
- values.sort()
- duplicates = []
- for i in range(1, len(values)):
- if values[i-1] == values[i]:
- duplicates.append(values[i])
- if duplicates:
- raise ValueError("%s %s" % (prefix, duplicates))
-
-
########################################################################
# General utility functions
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:23:00 UTC (rev 1002)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:48:46 UTC (rev 1003)
@@ -1936,3 +1936,56 @@
return result
return path
+
+#########################
+# checkUnique() function
+#########################
+
+def checkUnique(prefix, values):
+ """
+ Checks that all values are unique.
+
+ The values list is checked for duplicate values. If there are
+ duplicates, an exception is thrown. All duplicate values are listed in
+ the exception.
+
+ @param prefix: Prefix to use in the thrown exception
+ @param values: List of values to check
+
+ @raise ValueError: If there are duplicates in the list
+ """
+ values.sort()
+ duplicates = []
+ for i in range(1, len(values)):
+ if values[i-1] == values[i]:
+ duplicates.append(values[i])
+ if duplicates:
+ raise ValueError("%s %s" % (prefix, duplicates))
+
+
+#######################################
+# parseCommaSeparatedString() function
+#######################################
+
+def parseCommaSeparatedString(commaString):
+ """
+ Parses a list of values out of a comma-separated string.
+
+ The items in the list are split by comma, and then have whitespace
+ stripped. As a special case, if C{commaString} is C{None}, then C{None}
+ will be returned.
+
+ @param commaString: List of values in comma-separated string format.
+ @return: Values from commaString split into a list, or C{None}.
+ """
+ if commaString is None:
+ return None
+ else:
+ pass1 = commaString.split(",")
+ pass2 = []
+ for item in pass1:
+ item = item.strip()
+ if len(item) > 0:
+ pass2.append(item)
+ return pass2
+
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 20:23:00 UTC (rev 1002)
+++ cedar-backup2/trunk/Changelog 2010-07-07 20:48:46 UTC (rev 1003)
@@ -1,5 +1,6 @@
Version 2.20.0 unreleased
+ * This is a cleanup release with no functional changes.
* Switch to minimum Python version of 2.5 (everyone should have it now).
- Make cback script more robust in the case of a bad interpreter version
- Change file headers, comments, manual, etc. to reference Python 2.5
@@ -11,7 +12,8 @@
- Move unit tests into testcase folder to avoid test.py naming conflict
* Remove "Translate [x:y] into [a:b]" debug message for uid/gid translation.
* Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls.
- * Remove configuration boilerplate "As with all of the ... are optional..."
+ * Remove boilerplate comments "As with all of the ... " in config code.
+ * Refactor checkUnique() and parseCommaSeparatedString() from config to util.
Version 2.19.6 22 May 2010
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-07 20:23:00 UTC (rev 1002)
+++ cedar-backup2/trunk/TODO 2010-07-07 20:48:46 UTC (rev 1003)
@@ -78,9 +78,6 @@
If each extension really has its own Config object (?) pull out common parsing code
Config code is generally readable, might not be worth abstracting it
- Not sure that comments are worth it -- they're longer than the method body
-Pull out general utilities from config parsing
- - Comma-separated string
- - Check unique
FilesystemList
- excludePaths should become excludedPaths (to differentiate from flags)
- same goes for other lists and maybe ignoreFile (ignoreFileName?)
@@ -90,7 +87,6 @@
- In fact, maybe the knapsack algorithms could operate on a filesystem list instead of the the other way around?
- or, a knapsack algorithm is some sort of predicate or "filter" on a list ???
remove image.py
-maybe get rid of epydoc @type declarations -- they clutter things up and aren't that useful (?)
should common test methods be put into a test case superclass?
- here, I'm thinking of the tar stuff, the "raise on assign failure" etc.
- maybe looking up resources is something a test class always does?
@@ -104,7 +100,7 @@
Get rid of specialized Subversion repository configuration (BDBRepository, FSFSRepository, etc.)
Come up with standard parsing for config items lots of code uses -- exclusions, for example
Spread out the functionality for the validate action
-Standardize on a way to "merge" several levels of configuration for a parmeters that exist on more than one level
+Standardize on a way to "merge" several levels of configuration for a parameters that exist on more than one level
get rid of store.writeImage() -- or rather, rename writeImageBlankSafe to be writeImage
Come up with a way to better share store and rebuild functionality
- Can one extension class provide more than one command, maybe with two named methods?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-07 21:04:04
|
Revision: 1006
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1006&view=rev
Author: pronovic
Date: 2010-07-07 21:03:57 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Update copyright statement to include 2010
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/collect.py
cedar-backup2/trunk/CedarBackup2/actions/initialize.py
cedar-backup2/trunk/CedarBackup2/actions/purge.py
cedar-backup2/trunk/CedarBackup2/actions/rebuild.py
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/actions/store.py
cedar-backup2/trunk/CedarBackup2/actions/util.py
cedar-backup2/trunk/CedarBackup2/actions/validate.py
cedar-backup2/trunk/CedarBackup2/extend/capacity.py
cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
cedar-backup2/trunk/CedarBackup2/extend/mbox.py
cedar-backup2/trunk/CedarBackup2/extend/mysql.py
cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
cedar-backup2/trunk/CedarBackup2/extend/split.py
cedar-backup2/trunk/CedarBackup2/extend/subversion.py
cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/knapsack.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/util.py
cedar-backup2/trunk/CedarBackup2/xmlutil.py
cedar-backup2/trunk/doc/cback-span.1
cedar-backup2/trunk/doc/cback.1
cedar-backup2/trunk/manual/src/basic.xml
cedar-backup2/trunk/manual/src/book.xml
cedar-backup2/trunk/manual/src/commandline.xml
cedar-backup2/trunk/manual/src/config.xml
cedar-backup2/trunk/manual/src/copyright.xml
cedar-backup2/trunk/manual/src/depends.xml
cedar-backup2/trunk/manual/src/extensions.xml
cedar-backup2/trunk/manual/src/extenspec.xml
cedar-backup2/trunk/manual/src/install.xml
cedar-backup2/trunk/manual/src/intro.xml
cedar-backup2/trunk/manual/src/preface.xml
cedar-backup2/trunk/manual/src/recovering.xml
cedar-backup2/trunk/manual/src/securingssh.xml
cedar-backup2/trunk/testcase/actionsutiltests.py
cedar-backup2/trunk/testcase/capacitytests.py
cedar-backup2/trunk/testcase/cdwritertests.py
cedar-backup2/trunk/testcase/clitests.py
cedar-backup2/trunk/testcase/dvdwritertests.py
cedar-backup2/trunk/testcase/encrypttests.py
cedar-backup2/trunk/testcase/filesystemtests.py
cedar-backup2/trunk/testcase/knapsacktests.py
cedar-backup2/trunk/testcase/mboxtests.py
cedar-backup2/trunk/testcase/mysqltests.py
cedar-backup2/trunk/testcase/peertests.py
cedar-backup2/trunk/testcase/postgresqltests.py
cedar-backup2/trunk/testcase/spantests.py
cedar-backup2/trunk/testcase/splittests.py
cedar-backup2/trunk/testcase/subversiontests.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/testcase/writersutiltests.py
cedar-backup2/trunk/util/createtree.py
cedar-backup2/trunk/util/knapsackdemo.py
Modified: cedar-backup2/trunk/CedarBackup2/actions/collect.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/collect.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/collect.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/initialize.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/initialize.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/initialize.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/purge.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/purge.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/purge.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/rebuild.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/rebuild.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/rebuild.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/store.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/actions/validate.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/validate.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/actions/validate.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/capacity.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2008 Kenneth J. Pronovici.
+# Copyright (c) 2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/mbox.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2006-2007 Kenneth J. Pronovici.
+# Copyright (c) 2006-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/mysql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005 Kenneth J. Pronovici.
+# Copyright (c) 2005,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2006 Kenneth J. Pronovici.
+# Copyright (c) 2006,2010 Kenneth J. Pronovici.
# Copyright (c) 2006 Antoine Beaupre.
# All rights reserved.
#
Modified: cedar-backup2/trunk/CedarBackup2/extend/split.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/subversion.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005,2007 Kenneth J. Pronovici.
+# Copyright (c) 2005,2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/extend/sysinfo.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005 Kenneth J. Pronovici.
+# Copyright (c) 2005,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/knapsack.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/knapsack.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/knapsack.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2005 Kenneth J. Pronovici.
+# Copyright (c) 2004-2005,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
-VERSION = "2.19.7"
+VERSION = "2.20.0"
DATE = "unreleased"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2006,2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2006,2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# Portions copyright (c) 2001, 2002 Python Software Foundation.
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007-2008 Kenneth J. Pronovici.
+# Copyright (c) 2007-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/writers/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/CedarBackup2/xmlutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/xmlutil.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/CedarBackup2/xmlutil.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2006 Kenneth J. Pronovici.
+# Copyright (c) 2004-2006,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# Portions Copyright (c) 2000 Fourthought Inc, USA.
Modified: cedar-backup2/trunk/doc/cback-span.1
===================================================================
--- cedar-backup2/trunk/doc/cback-span.1 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/doc/cback-span.1 2010-07-07 21:03:57 UTC (rev 1006)
@@ -127,7 +127,7 @@
.SH AUTHOR
Written by Kenneth J. Pronovici <pro...@ie...>.
.SH COPYRIGHT
-Copyright (c) 2007 Kenneth J. Pronovici.
+Copyright (c) 2007,2010 Kenneth J. Pronovici.
.br
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
Modified: cedar-backup2/trunk/doc/cback.1
===================================================================
--- cedar-backup2/trunk/doc/cback.1 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/doc/cback.1 2010-07-07 21:03:57 UTC (rev 1006)
@@ -228,7 +228,7 @@
.SH AUTHOR
Written by Kenneth J. Pronovici <pro...@ie...>.
.SH COPYRIGHT
-Copyright (c) 2004-2008 Kenneth J. Pronovici.
+Copyright (c) 2004-2010 Kenneth J. Pronovici.
.br
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
Modified: cedar-backup2/trunk/manual/src/basic.xml
===================================================================
--- cedar-backup2/trunk/manual/src/basic.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/basic.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/book.xml
===================================================================
--- cedar-backup2/trunk/manual/src/book.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/book.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/commandline.xml
===================================================================
--- cedar-backup2/trunk/manual/src/commandline.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/commandline.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2007 Kenneth J. Pronovici.
+# Copyright (c) 2005-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/config.xml
===================================================================
--- cedar-backup2/trunk/manual/src/config.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/config.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/copyright.xml
===================================================================
--- cedar-backup2/trunk/manual/src/copyright.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/copyright.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
<programlisting>
-Copyright (c) 2005-2008
+Copyright (c) 2005-2010
Kenneth J. Pronovici
This work is free; you can redistribute it and/or modify it under
Modified: cedar-backup2/trunk/manual/src/depends.xml
===================================================================
--- cedar-backup2/trunk/manual/src/depends.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/depends.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2007 Kenneth J. Pronovici.
+# Copyright (c) 2005-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/extensions.xml
===================================================================
--- cedar-backup2/trunk/manual/src/extensions.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/extensions.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/extenspec.xml
===================================================================
--- cedar-backup2/trunk/manual/src/extenspec.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/extenspec.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2007 Kenneth J. Pronovici.
+# Copyright (c) 2005-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/install.xml
===================================================================
--- cedar-backup2/trunk/manual/src/install.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/install.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2008 Kenneth J. Pronovici.
+# Copyright (c) 2005-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/intro.xml
===================================================================
--- cedar-backup2/trunk/manual/src/intro.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/intro.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2007 Kenneth J. Pronovici.
+# Copyright (c) 2005-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/preface.xml
===================================================================
--- cedar-backup2/trunk/manual/src/preface.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/preface.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2007 Kenneth J. Pronovici.
+# Copyright (c) 2005-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/recovering.xml
===================================================================
--- cedar-backup2/trunk/manual/src/recovering.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/recovering.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2005-2006 Kenneth J. Pronovici.
+# Copyright (c) 2005-2006,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/manual/src/securingssh.xml
===================================================================
--- cedar-backup2/trunk/manual/src/securingssh.xml 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/manual/src/securingssh.xml 2010-07-07 21:03:57 UTC (rev 1006)
@@ -7,7 +7,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This work is free; you can redistribute it and/or modify it
Modified: cedar-backup2/trunk/testcase/actionsutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/actionsutiltests.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/testcase/actionsutiltests.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/testcase/capacitytests.py
===================================================================
--- cedar-backup2/trunk/testcase/capacitytests.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/testcase/capacitytests.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2008 Kenneth J. Pronovici.
+# Copyright (c) 2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/testcase/cdwritertests.py
===================================================================
--- cedar-backup2/trunk/testcase/cdwritertests.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/testcase/cdwritertests.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/testcase/clitests.py
===================================================================
--- cedar-backup2/trunk/testcase/clitests.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/testcase/clitests.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2005,2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2005,2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/testcase/dvdwritertests.py
===================================================================
--- cedar-backup2/trunk/testcase/dvdwritertests.py 2010-07-07 21:03:15 UTC (rev 1005)
+++ cedar-backup2/trunk/testcase/dvdwritertests.py 2010-07-07 21:03:57 UTC (rev 1006)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
Modified: cedar-backup2/trunk/testcase/encrypttests.py
==============...
[truncated message content] |
|
From: <pro...@us...> - 2010-07-07 21:37:03
|
Revision: 1008
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1008&view=rev
Author: pronovic
Date: 2010-07-07 21:36:57 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Release 2.20.0
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 21:33:58 UTC (rev 1007)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 21:36:57 UTC (rev 1008)
@@ -35,6 +35,6 @@
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
VERSION = "2.20.0"
-DATE = "unreleased"
+DATE = "07 Jul 2010"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 21:33:58 UTC (rev 1007)
+++ cedar-backup2/trunk/Changelog 2010-07-07 21:36:57 UTC (rev 1008)
@@ -1,4 +1,4 @@
-Version 2.20.0 unreleased
+Version 2.20.0 07 Jul 2010
* This is a cleanup release with no functional changes.
* Switch to minimum Python version of 2.5 (everyone should have it now).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-10 23:58:36
|
Revision: 1011
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1011&view=rev
Author: pronovic
Date: 2010-07-10 23:58:29 +0000 (Sat, 10 Jul 2010)
Log Message:
-----------
Fix minor formatting bugs in manpages, pointed out by Debian lintian
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/doc/cback-span.1
cedar-backup2/trunk/doc/cback.1
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 21:57:35 UTC (rev 1010)
+++ cedar-backup2/trunk/Changelog 2010-07-10 23:58:29 UTC (rev 1011)
@@ -1,3 +1,7 @@
+Version 2.20.1 unreleased
+
+ * Fix minor formatting issues in manpages, pointed out by Debian lintian.
+
Version 2.20.0 07 Jul 2010
* This is a cleanup release with no functional changes.
Modified: cedar-backup2/trunk/doc/cback-span.1
===================================================================
--- cedar-backup2/trunk/doc/cback-span.1 2010-07-07 21:57:35 UTC (rev 1010)
+++ cedar-backup2/trunk/doc/cback-span.1 2010-07-10 23:58:29 UTC (rev 1011)
@@ -15,11 +15,11 @@
.\" #
.\" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
.\"
-.TH cback-span "1" "Feb 2007" "Cedar Backup" "Kenneth J. Pronovici"
+.TH cback\-span "1" "July 2010" "Cedar Backup" "Kenneth J. Pronovici"
.SH NAME
-cback-span \- Span staged data among multiple discs
+cback\-span \- Span staged data among multiple discs
.SH SYNOPSIS
-.B cback-span
+.B cback\-span
[\fIswitches\fR]
.SH DESCRIPTION
.PP
@@ -28,7 +28,7 @@
staged data between more than one disc. It can't be a Cedar Backup extension
in the usual sense because it requires user input when switching media.
.PP
-Generally, one can run the cback-span command with no arguments. This will
+Generally, one can run the cback\-span command with no arguments. This will
start it using the default configuration file, the default log file, etc. You
only need to use the switches if you need to change the default behavior.
.PP
@@ -66,7 +66,7 @@
.TP
\fB\-m\fR, \fB\-\-mode\fR
Specify the permissions for the logfile, using the numeric mode as in chmod(1).
-The default mode is 640 (-rw-r-----). This value will only be used when
+The default mode is 640 (\-rw\-r\-\-\-\-\-). This value will only be used when
creating a new logfile. If the logfile already exists when the cback script is
executed, it will retain its existing ownership and mode.
.TP
@@ -79,7 +79,7 @@
\fB\-d\fR, \fB\-\-debug\fR
Write debugging information to the logfile. This option produces a high volume
of output, and would generally only be needed when debugging a problem. This
-option implies the --output option, as well.
+option implies the \-\-output option, as well.
.TP
\fB\-s\fR, \fB\-\-stack\fR
Dump a Python stack trace instead of swallowing exceptions. This forces Cedar
@@ -96,7 +96,7 @@
The Python interpreter version is < 2.5.
.TP
\fB2\fR
-Error processing command-line arguments.
+Error processing command\-line arguments.
.TP
\fB3\fR
Error configuring logging.
@@ -105,7 +105,7 @@
Error parsing indicated configuration file.
.TP
\fB5\fR
-Backup was interrupted with a CTRL-C or similar.
+Backup was interrupted with a CTRL\-C or similar.
.TP
\fB6\fR
Other error during processing.
@@ -123,7 +123,7 @@
.TP
\fI/var/log/cback.log\fR - Default log file
.SH BUGS
-Report bugs to <su...@ce...>.
+Report bugs to <support@cedar\-solutions.com>.
.SH AUTHOR
Written by Kenneth J. Pronovici <pro...@ie...>.
.SH COPYRIGHT
Modified: cedar-backup2/trunk/doc/cback.1
===================================================================
--- cedar-backup2/trunk/doc/cback.1 2010-07-07 21:57:35 UTC (rev 1010)
+++ cedar-backup2/trunk/doc/cback.1 2010-07-10 23:58:29 UTC (rev 1011)
@@ -15,16 +15,16 @@
.\" #
.\" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
.\"
-.TH cback "1" "March 2008" "Cedar Backup" "Kenneth J. Pronovici"
+.TH cback "1" "July 2010" "Cedar Backup" "Kenneth J. Pronovici"
.SH NAME
-cback \- Local and remote backups to CD-R/CD-RW media
+cback \- Local and remote backups to CD\-R/CD\-RW media
.SH SYNOPSIS
.B cback
[\fIswitches\fR]
action(s)
.SH DESCRIPTION
.PP
-The cback script provides the command-line interface for Cedar Backup.
+The cback script provides the command\-line interface for Cedar Backup.
Cedar Backup is a software package designed to manage system backups for a
pool of local and remote machines. Cedar Backup understands how to back up
filesystem data as well as MySQL and PostgreSQL databases and Subversion
@@ -38,7 +38,7 @@
a daily basis.
.PP
There are two kinds of machines in a Cedar Backup pool. One machine (the
-\fImaster\fR) has a CD-R or CD-RW drive on it and is where the backup is
+\fImaster\fR) has a CD\-R or CD\-RW drive on it and is where the backup is
written to disc. The others (\fIclients\fR) collect data to be written to disc
by the master. Collectively, the master and client machines in a pool are all
referred to as \fIpeer\fR machines. There are four actions that take place as
@@ -87,7 +87,7 @@
\fB\-N\fR, \fB\-\-managed-only\fR
Include only managed clients when executing actions. If the action being
executed is listed as a managed action for a managed client, execute the action
-on that client -- but do not execute the action locally.
+on that client, but do not execute the action locally.
.TP
\fB\-l\fR, \fB\-\-logfile\fR
Specify the path to an alternate logfile. The default logfile file is
@@ -103,7 +103,7 @@
.TP
\fB\-m\fR, \fB\-\-mode\fR
Specify the permissions for the logfile, using the numeric mode as in chmod(1).
-The default mode is 640 (-rw-r-----). This value will only be used when
+The default mode is 640 (\-rw\-r\-\-\-\-\-). This value will only be used when
creating a new logfile. If the logfile already exists when the cback script is
executed, it will retain its existing ownership and mode.
.TP
@@ -116,7 +116,7 @@
\fB\-d\fR, \fB\-\-debug\fR
Write debugging information to the logfile. This option produces a high volume
of output, and would generally only be needed when debugging a problem. This
-option implies the --output option, as well.
+option implies the \-\-output option, as well.
.TP
\fB\-s\fR, \fB\-\-stack\fR
Dump a Python stack trace instead of swallowing exceptions. This forces Cedar
@@ -169,7 +169,7 @@
The Python interpreter version is < 2.5.
.TP
\fB2\fR
-Error processing command-line arguments.
+Error processing command\-line arguments.
.TP
\fB3\fR
Error configuring logging.
@@ -178,7 +178,7 @@
Error parsing indicated configuration file.
.TP
\fB5\fR
-Backup was interrupted with a CTRL-C or similar.
+Backup was interrupted with a CTRL\-C or similar.
.TP
\fB6\fR
Error executing specified backup actions.
@@ -219,16 +219,16 @@
.PP
There probably are bugs in this code. However, it is in active use for my own
backups, and I fix problems as I notice them. If you find a bug, please report
-it. If possible, give me the output from --diagnostics, all of the error
-messages that the script printed into its log, and also any stack-traces
+it. If possible, give me the output from \-\-diagnostics, all of the error
+messages that the script printed into its log, and also any stack\-traces
(exceptions) that Python printed. It would be even better if you could tell me
how to reproduce the problem (i.e. by sending me your configuration file).
.PP
-Report bugs to <su...@ce...>.
+Report bugs to <support@cedar\-solutions.com>.
.SH AUTHOR
Written by Kenneth J. Pronovici <pro...@ie...>.
.SH COPYRIGHT
-Copyright (c) 2004-2010 Kenneth J. Pronovici.
+Copyright (c) 2004\-2010 Kenneth J. Pronovici.
.br
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-10-20 01:06:16
|
Revision: 1013
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1013&view=rev
Author: pronovic
Date: 2010-10-20 01:06:10 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
Tweaks to logging setup for Python 2.7
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2010-07-11 00:01:08 UTC (rev 1012)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-10-20 01:06:10 UTC (rev 1013)
@@ -1058,9 +1058,9 @@
logfile = options.logfile
if not os.path.exists(logfile):
if options.mode is None:
- os.fdopen(os.open(logfile, os.O_CREAT|os.O_APPEND, DEFAULT_MODE)).write("")
+ os.fdopen(os.open(logfile, os.O_RDWR|os.O_CREAT|os.O_APPEND, DEFAULT_MODE), "a+").write("")
else:
- os.fdopen(os.open(logfile, os.O_CREAT|os.O_APPEND, options.mode)).write("")
+ os.fdopen(os.open(logfile, os.O_RDWR|os.O_CREAT|os.O_APPEND, options.mode), "a+").write("")
try:
if options.owner is None or len(options.owner) < 2:
(uid, gid) = getUidGid(DEFAULT_OWNERSHIP[0], DEFAULT_OWNERSHIP[1])
@@ -1114,7 +1114,7 @@
@param options: Command-line options.
"""
formatter = logging.Formatter(fmt=SCREEN_LOG_FORMAT)
- handler = logging.StreamHandler(strm=SCREEN_LOG_STREAM)
+ handler = logging.StreamHandler(SCREEN_LOG_STREAM)
handler.setFormatter(formatter)
if options.quiet:
handler.setLevel(logging.CRITICAL) # effectively turn it off
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-11 00:01:08 UTC (rev 1012)
+++ cedar-backup2/trunk/Changelog 2010-10-20 01:06:10 UTC (rev 1013)
@@ -1,6 +1,9 @@
Version 2.20.1 unreleased
* Fix minor formatting issues in manpages, pointed out by Debian lintian.
+ * Changes required to make code compatible with Python 2.7
+ - StreamHandler no longer accepts strm= argument (closes: #3079930)
+ - Modify logfile os.fdopen() to be explicit about read/write mode
Version 2.20.0 07 Jul 2010
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-10-20 01:38:30
|
Revision: 1014
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1014&view=rev
Author: pronovic
Date: 2010-10-20 01:38:23 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
Fix tests that extract a tarfile twice (exposed by new error behavior)
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/testcase/filesystemtests.py
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-10-20 01:06:10 UTC (rev 1013)
+++ cedar-backup2/trunk/Changelog 2010-10-20 01:38:23 UTC (rev 1014)
@@ -4,6 +4,7 @@
* Changes required to make code compatible with Python 2.7
- StreamHandler no longer accepts strm= argument (closes: #3079930)
- Modify logfile os.fdopen() to be explicit about read/write mode
+ - Fix tests that extract a tarfile twice (exposed by new error behavior)
Version 2.20.0 07 Jul 2010
Modified: cedar-backup2/trunk/testcase/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/testcase/filesystemtests.py 2010-10-20 01:06:10 UTC (rev 1013)
+++ cedar-backup2/trunk/testcase/filesystemtests.py 2010-10-20 01:38:23 UTC (rev 1014)
@@ -539,13 +539,13 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
count = fsList.addFile(path)
self.failUnlessEqual(1, count)
self.failUnlessEqual([path], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
self.failUnlessRaises(ValueError, fsList.addFile, path)
@@ -586,6 +586,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeFiles = True
@@ -593,7 +594,6 @@
self.failUnlessEqual(0, count)
self.failUnlessEqual([], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeFiles = True
@@ -636,6 +636,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeDirs = True
@@ -643,7 +644,6 @@
self.failUnlessEqual(1, count)
self.failUnlessEqual([path], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeDirs = True
@@ -688,6 +688,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeLinks = True
@@ -695,7 +696,6 @@
self.failUnlessEqual(0, count)
self.failUnlessEqual([], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeLinks = True
@@ -740,6 +740,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ path ]
@@ -747,7 +748,6 @@
self.failUnlessEqual(0, count)
self.failUnlessEqual([], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ path ]
@@ -791,6 +791,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -798,7 +799,6 @@
self.failUnlessEqual(1, count)
self.failUnlessEqual([path], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -842,6 +842,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
@@ -849,7 +850,6 @@
self.failUnlessEqual(0, count)
self.failUnlessEqual([], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
@@ -893,6 +893,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -900,7 +901,6 @@
self.failUnlessEqual(1, count)
self.failUnlessEqual([path], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -980,6 +980,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
@@ -987,7 +988,6 @@
self.failUnlessEqual(0, count)
self.failUnlessEqual([], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
@@ -1034,6 +1034,7 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePaths = [ NOMATCH_BASENAME ]
@@ -1041,7 +1042,6 @@
self.failUnlessEqual(1, count)
self.failUnlessEqual([path], fsList)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePaths = [ NOMATCH_BASENAME ]
@@ -1088,11 +1088,11 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
count = fsList.addDir(path)
@@ -1135,12 +1135,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeFiles = True
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeFiles = True
@@ -1185,12 +1185,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeDirs = True
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeDirs = True
@@ -1237,12 +1237,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeLinks = True
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeLinks = True
@@ -1289,12 +1289,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ path ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ path ]
@@ -1341,12 +1341,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -1393,12 +1393,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
@@ -1445,12 +1445,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePatterns = [ NOMATCH_PATH ]
@@ -1520,12 +1520,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
@@ -1574,12 +1574,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ NOMATCH_BASENAME ]
self.failUnlessRaises(ValueError, fsList.addDir, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ NOMATCH_BASENAME ]
@@ -1628,11 +1628,11 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
count = fsList.addDir(path)
@@ -1719,12 +1719,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeFiles = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeFiles = True
@@ -1812,12 +1812,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeDirs = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeDirs = True
@@ -1905,12 +1905,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeLinks = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeLinks = True
@@ -2005,12 +2005,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ path ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ path ]
@@ -2097,12 +2097,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePaths = [ NOMATCH_PATH ]
@@ -2198,12 +2198,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
@@ -2291,12 +2291,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludePatterns = [ NOMATCH_PATH ]
@@ -3900,12 +3900,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
@@ -3995,12 +3995,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ NOMATCH_BASENAME ]
@@ -5715,12 +5715,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeFiles = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to dir003
fsList = FilesystemList()
fsList.excludeFiles = True
@@ -5734,12 +5734,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeDirs = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to dir003
fsList = FilesystemList()
fsList.excludeDirs = True
@@ -5753,12 +5753,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeLinks = True
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to dir003
fsList = FilesystemList()
fsList.excludeLinks = True
@@ -5773,12 +5773,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePaths = [ path ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to dir003
fsList = FilesystemList()
fsList.excludePaths = [ path ]
@@ -5793,12 +5793,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to dir003
fsList = FilesystemList()
fsList.excludePatterns = [ self.pathPattern(path) ]
@@ -5872,12 +5872,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
self.failUnlessRaises(ValueError, fsList.addDirContents, path, True, True, 1, True)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
fsList = FilesystemList()
fsList.excludeBasenamePatterns = [ "link001", ]
@@ -19476,11 +19476,11 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
count = purgeList.addDir(path)
@@ -19566,12 +19566,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludeFiles = True
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludeFiles = True
@@ -19658,12 +19658,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludeDirs = True
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludeDirs = True
@@ -19751,12 +19751,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludeLinks = True
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludeLinks = True
@@ -19850,12 +19850,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludePaths = [ path ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludePaths = [ path ]
@@ -19942,12 +19942,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludePaths = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludePaths = [ NOMATCH_PATH ]
@@ -20042,12 +20042,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludePatterns = [ self.pathPattern(path) ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludePatterns = [ self.pathPattern(path) ]
@@ -20135,12 +20135,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludePatterns = [ NOMATCH_PATH ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludePatterns = [ NOMATCH_PATH ]
@@ -21596,12 +21596,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludeBasenamePatterns = [ "link001", ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludeBasenamePatterns = [ "link001", ]
@@ -21691,12 +21691,12 @@
"""
if platformSupportsLinks():
self.extractTar("tree5")
+
path = self.buildPath(["tree5", "link001"]) # link to a file
purgeList = PurgeItemList()
purgeList.excludeBasenamePatterns = [ NOMATCH_BASENAME ]
self.failUnlessRaises(ValueError, purgeList.addDirContents, path)
- self.extractTar("tree5")
path = self.buildPath(["tree5", "dir002", "link001"]) # link to a dir
purgeList = PurgeItemList()
purgeList.excludeBasenamePatterns = [ NOMATCH_BASENAME ]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-10-20 01:55:50
|
Revision: 1015
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1015&view=rev
Author: pronovic
Date: 2010-10-20 01:55:44 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
Release 2.20.1
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-10-20 01:38:23 UTC (rev 1014)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-10-20 01:55:44 UTC (rev 1015)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
-VERSION = "2.20.0"
-DATE = "07 Jul 2010"
+VERSION = "2.20.1"
+DATE = "19 Oct 2010"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-10-20 01:38:23 UTC (rev 1014)
+++ cedar-backup2/trunk/Changelog 2010-10-20 01:55:44 UTC (rev 1015)
@@ -1,4 +1,4 @@
-Version 2.20.1 unreleased
+Version 2.20.1 19 Oct 2010
* Fix minor formatting issues in manpages, pointed out by Debian lintian.
* Changes required to make code compatible with Python 2.7
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2011-10-10 03:27:41
|
Revision: 1018
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1018&view=rev
Author: pronovic
Date: 2011-10-10 03:27:34 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Implement recursive collect (original patch from Zoran Bosnjak)
Modified Paths:
--------------
cedar-backup2/trunk/CREDITS
cedar-backup2/trunk/CedarBackup2/actions/collect.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/manual/src/config.xml
cedar-backup2/trunk/testcase/configtests.py
cedar-backup2/trunk/testcase/data/cback.conf.8
Modified: cedar-backup2/trunk/CREDITS
===================================================================
--- cedar-backup2/trunk/CREDITS 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/CREDITS 2011-10-10 03:27:34 UTC (rev 1018)
@@ -23,7 +23,7 @@
software, as indicated in the source code itself.
Unless otherwise indicated, all Cedar Backup source code is Copyright
-(c) 2004-2010 Kenneth J. Pronovici and is released under the GNU General
+(c) 2004-2011 Kenneth J. Pronovici and is released under the GNU General
Public License. The contents of the GNU General Public License can be
found in the LICENSE file, or can be downloaded from http://www.gnu.org/.
@@ -32,6 +32,9 @@
the optimized media blanking strategy as well as improvements to the DVD
writer implementation.
+Zoran Bosnjak contributed changes to collect.py to implement recursive
+collect behavior based on recursion level.
+
The PostgreSQL extension was contributed by Antoine Beaupre, based on
the existing MySQL extension.
Modified: cedar-backup2/trunk/CedarBackup2/actions/collect.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/collect.py 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/CedarBackup2/actions/collect.py 2011-10-10 03:27:34 UTC (rev 1018)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2011 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -53,7 +53,7 @@
import pickle
# Cedar Backup modules
-from CedarBackup2.filesystem import BackupFileList
+from CedarBackup2.filesystem import BackupFileList, FilesystemList
from CedarBackup2.util import isStartOfWeek, changeOwnership, displayBytes, buildNormalizedPath
from CedarBackup2.actions.constants import DIGEST_EXTENSION, COLLECT_INDICATOR
from CedarBackup2.actions.util import writeIndicatorFile
@@ -111,8 +111,8 @@
logger.debug("Working with collect file [%s]" % collectFile.absolutePath)
collectMode = _getCollectMode(config, collectFile)
archiveMode = _getArchiveMode(config, collectFile)
- digestPath = _getDigestPath(config, collectFile)
- tarfilePath = _getTarfilePath(config, collectFile, archiveMode)
+ digestPath = _getDigestPath(config, collectFile.absolutePath)
+ tarfilePath = _getTarfilePath(config, collectFile.absolutePath, archiveMode)
if fullBackup or (collectMode in ['daily', 'incr', ]) or (collectMode == 'weekly' and todayIsStart):
logger.debug("File meets criteria to be backed up today.")
_collectFile(config, collectFile.absolutePath, tarfilePath,
@@ -128,14 +128,13 @@
ignoreFile = _getIgnoreFile(config, collectDir)
linkDepth = _getLinkDepth(collectDir)
dereference = _getDereference(collectDir)
- digestPath = _getDigestPath(config, collectDir)
- tarfilePath = _getTarfilePath(config, collectDir, archiveMode)
+ recursionLevel = _getRecursionLevel(collectDir)
(excludePaths, excludePatterns) = _getExclusions(config, collectDir)
if fullBackup or (collectMode in ['daily', 'incr', ]) or (collectMode == 'weekly' and todayIsStart):
logger.debug("Directory meets criteria to be backed up today.")
- _collectDirectory(config, collectDir.absolutePath, tarfilePath,
+ _collectDirectory(config, collectDir.absolutePath,
collectMode, archiveMode, ignoreFile, linkDepth, dereference,
- resetDigest, digestPath, excludePaths, excludePatterns)
+ resetDigest, excludePaths, excludePatterns, recursionLevel)
else:
logger.debug("Directory will not be backed up, per collect mode.")
logger.info("Completed collecting directory [%s]" % collectDir.absolutePath)
@@ -182,9 +181,9 @@
# _collectDirectory() function
###############################
-def _collectDirectory(config, absolutePath, tarfilePath, collectMode, archiveMode,
- ignoreFile, linkDepth, dereference, resetDigest, digestPath,
- excludePaths, excludePatterns):
+def _collectDirectory(config, absolutePath, collectMode, archiveMode,
+ ignoreFile, linkDepth, dereference, resetDigest,
+ excludePaths, excludePatterns, recursionLevel):
"""
Collects a configured collect directory.
@@ -199,25 +198,51 @@
@param config: Config object.
@param absolutePath: Absolute path of directory to collect.
- @param tarfilePath: Path to tarfile that should be created.
@param collectMode: Collect mode to use.
@param archiveMode: Archive mode to use.
@param ignoreFile: Ignore file to use.
@param linkDepth: Link depth value to use.
@param dereference: Dereference flag to use.
@param resetDigest: Reset digest flag.
- @param digestPath: Path to digest file on disk, if needed.
@param excludePaths: List of absolute paths to exclude.
@param excludePatterns: List of patterns to exclude.
+ @param recursionLevel: Recursion level (zero for no recursion)
"""
- backupList = BackupFileList()
- backupList.ignoreFile = ignoreFile
- backupList.excludePaths = excludePaths
- backupList.excludePatterns = excludePatterns
- backupList.addDirContents(absolutePath, linkDepth=linkDepth, dereference=dereference)
- _executeBackup(config, backupList, absolutePath, tarfilePath, collectMode, archiveMode, resetDigest, digestPath)
+ if recursionLevel == 0:
+ # Collect the actual directory because we're at recursion level 0
+ logger.info("Collecting directory [%s]" % absolutePath)
+ tarfilePath = _getTarfilePath(config, absolutePath, archiveMode)
+ digestPath = _getDigestPath(config, absolutePath)
+ backupList = BackupFileList()
+ backupList.ignoreFile = ignoreFile
+ backupList.excludePaths = excludePaths
+ backupList.excludePatterns = excludePatterns
+ backupList.addDirContents(absolutePath, linkDepth=linkDepth, dereference=dereference)
+ _executeBackup(config, backupList, absolutePath, tarfilePath, collectMode, archiveMode, resetDigest, digestPath)
+ else:
+ # Find all of the immediate subdirectories
+ subdirs = FilesystemList()
+ subdirs.excludeFiles = True
+ subdirs.excludeLinks = True
+ subdirs.excludePaths = excludePaths
+ subdirs.excludePatterns = excludePatterns
+ subdirs.addDirContents(path=absolutePath, recursive=False, addSelf=False)
+
+ # Back up the subdirectories separately
+ for subdir in subdirs:
+ _collectDirectory(config, subdir, collectMode, archiveMode,
+ ignoreFile, linkDepth, dereference, resetDigest,
+ excludePaths, excludePatterns, recursionLevel-1)
+ excludePaths.append(subdir) # this directory is already backed up, so exclude it
+
+ # Back up everything that hasn't previously been backed up
+ _collectDirectory(config, absolutePath, collectMode, archiveMode,
+ ignoreFile, linkDepth, dereference, resetDigest,
+ excludePaths, excludePatterns, 0)
+
+
############################
# _executeBackup() function
############################
@@ -398,7 +423,7 @@
Gets the link depth that should be used for a collect directory.
If possible, use the one on the directory, otherwise set a value of 0 (zero).
@param item: C{CollectDir} object
- @return: Ignore file to use.
+ @return: Link depth to use.
"""
if item.linkDepth is None:
linkDepth = 0
@@ -417,7 +442,7 @@
Gets the dereference flag that should be used for a collect directory.
If possible, use the one on the directory, otherwise set a value of False.
@param item: C{CollectDir} object
- @return: Ignore file to use.
+ @return: Dereference flag to use.
"""
if item.dereference is None:
dereference = False
@@ -427,18 +452,37 @@
return dereference
+################################
+# _getRecursionLevel() function
+################################
+
+def _getRecursionLevel(item):
+ """
+ Gets the recursion level that should be used for a collect directory.
+ If possible, use the one on the directory, otherwise set a value of 0 (zero).
+ @param item: C{CollectDir} object
+ @return: Recursion level to use.
+ """
+ if item.recursionLevel is None:
+ recursionLevel = 0
+ else:
+ recursionLevel = item.recursionLevel
+ logger.debug("Recursion level is [%d]" % recursionLevel)
+ return recursionLevel
+
+
############################
# _getDigestPath() function
############################
-def _getDigestPath(config, item):
+def _getDigestPath(config, absolutePath):
"""
Gets the digest path associated with a collect directory or file.
@param config: Config object.
- @param item: C{CollectFile} or C{CollectDir} object
+ @param absolutePath: Absolute path to generate digest for
@return: Absolute path to the digest associated with the collect directory or file.
"""
- normalized = buildNormalizedPath(item.absolutePath)
+ normalized = buildNormalizedPath(absolutePath)
filename = "%s.%s" % (normalized, DIGEST_EXTENSION)
digestPath = os.path.join(config.options.workingDir, filename)
logger.debug("Digest path is [%s]" % digestPath)
@@ -449,11 +493,11 @@
# _getTarfilePath() function
#############################
-def _getTarfilePath(config, item, archiveMode):
+def _getTarfilePath(config, absolutePath, archiveMode):
"""
Gets the tarfile path (including correct extension) associated with a collect directory.
@param config: Config object.
- @param item: C{CollectFile} or C{CollectDir} object
+ @param absolutePath: Absolute path to generate tarfile for
@param archiveMode: Archive mode to use for this tarfile.
@return: Absolute path to the tarfile associated with the collect directory.
"""
@@ -463,7 +507,7 @@
extension = "tar.gz"
elif archiveMode == 'tarbz2':
extension = "tar.bz2"
- normalized = buildNormalizedPath(item.absolutePath)
+ normalized = buildNormalizedPath(absolutePath)
filename = "%s.%s" % (normalized, extension)
tarfilePath = os.path.join(config.collect.targetDir, filename)
logger.debug("Tarfile path is [%s]" % tarfilePath)
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2011-10-10 03:27:34 UTC (rev 1018)
@@ -2934,11 +2934,12 @@
@sort: __init__, __repr__, __str__, __cmp__, targetDir,
collectMode, archiveMode, ignoreFile, absoluteExcludePaths,
- excludePatterns, collectFiles, collectDirs
+ excludePatterns, collectFiles, collectDirs, recursionLevel
"""
def __init__(self, targetDir=None, collectMode=None, archiveMode=None, ignoreFile=None,
- absoluteExcludePaths=None, excludePatterns=None, collectFiles=None, collectDirs=None):
+ absoluteExcludePaths=None, excludePatterns=None, collectFiles=None,
+ collectDirs=None, recursionLevel=None):
"""
Constructor for the C{CollectConfig} class.
@@ -2950,6 +2951,7 @@
@param excludePatterns: List of regular expression patterns to exclude.
@param collectFiles: List of collect files.
@param collectDirs: List of collect directories.
+ @param recursionLevel: Recursion level to use for recursive directory collection
@raise ValueError: If one of the values is invalid.
"""
@@ -2961,6 +2963,7 @@
self._excludePatterns = None
self._collectFiles = None
self._collectDirs = None
+ self._recursionLevel = None
self.targetDir = targetDir
self.collectMode = collectMode
self.archiveMode = archiveMode
@@ -2969,15 +2972,17 @@
self.excludePatterns = excludePatterns
self.collectFiles = collectFiles
self.collectDirs = collectDirs
+ self.recursionLevel = recursionLevel
def __repr__(self):
"""
Official string representation for class instance.
"""
- return "CollectConfig(%s, %s, %s, %s, %s, %s, %s, %s)" % (self.targetDir, self.collectMode, self.archiveMode,
- self.ignoreFile, self.absoluteExcludePaths,
- self.excludePatterns, self.collectFiles, self.collectDirs)
-
+ return "CollectConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.targetDir, self.collectMode, self.archiveMode,
+ self.ignoreFile, self.absoluteExcludePaths,
+ self.excludePatterns, self.collectFiles,
+ self.collectDirs, self.recursionLevel)
+
def __str__(self):
"""
Informal string representation for class instance.
@@ -3033,6 +3038,11 @@
return -1
else:
return 1
+ if self.recursionLevel != other.recursionLevel:
+ if self.recursionLevel < other.recursionLevel:
+ return -1
+ else:
+ return 1
return 0
def _setTargetDir(self, value):
@@ -3197,6 +3207,27 @@
"""
return self._collectDirs
+ def _setRecursionLevel(self, value):
+ """
+ Property target used to set the recursionLevel.
+ The value must be an integer.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is None:
+ self._recursionLevel = None
+ else:
+ try:
+ value = int(value)
+ except TypeError:
+ raise ValueError("Recusion level value must be an integer.")
+ self._recursionLevel = value
+
+ def _getRecursionLevel(self):
+ """
+ Property target used to get the action recursionLevel.
+ """
+ return self._recursionLevel
+
targetDir = property(_getTargetDir, _setTargetDir, None, "Directory to collect files into.")
collectMode = property(_getCollectMode, _setCollectMode, None, "Default collect mode.")
archiveMode = property(_getArchiveMode, _setArchiveMode, None, "Default archive mode for collect files.")
@@ -3205,6 +3236,7 @@
excludePatterns = property(_getExcludePatterns, _setExcludePatterns, None, "List of regular expressions patterns to exclude.")
collectFiles = property(_getCollectFiles, _setCollectFiles, None, "List of collect files.")
collectDirs = property(_getCollectDirs, _setCollectDirs, None, "List of collect directories.")
+ recursionLevel = property(_getRecursionLevel, _setRecursionLevel, None, "Recursion level to use for recursive directory collection")
########################################################################
@@ -4453,6 +4485,7 @@
collectMode //cb_config/collect/collect_mode
archiveMode //cb_config/collect/archive_mode
ignoreFile //cb_config/collect/ignore_file
+ recursionLevel //cb_config/collect/recursion_level
We also read groups of the following items, one list element per
item::
@@ -4479,6 +4512,7 @@
collect.collectMode = readString(sectionNode, "collect_mode")
collect.archiveMode = readString(sectionNode, "archive_mode")
collect.ignoreFile = readString(sectionNode, "ignore_file")
+ collect.recursionLevel = readInteger(sectionNode, "recursion_level")
(collect.absoluteExcludePaths, unused, collect.excludePatterns) = Config._parseExclusions(sectionNode)
collect.collectFiles = Config._parseCollectFiles(sectionNode)
collect.collectDirs = Config._parseCollectDirs(sectionNode)
@@ -5110,6 +5144,7 @@
collectMode //cb_config/collect/collect_mode
archiveMode //cb_config/collect/archive_mode
ignoreFile //cb_config/collect/ignore_file
+ recursionLevel //cb_config/collect/recursion_level
We also add groups of the following items, one list element per
item::
@@ -5134,6 +5169,7 @@
addStringNode(xmlDom, sectionNode, "collect_mode", collectConfig.collectMode)
addStringNode(xmlDom, sectionNode, "archive_mode", collectConfig.archiveMode)
addStringNode(xmlDom, sectionNode, "ignore_file", collectConfig.ignoreFile)
+ addStringNode(xmlDom, sectionNode, "recursion_level", collectConfig.recursionLevel)
if ((collectConfig.absoluteExcludePaths is not None and collectConfig.absoluteExcludePaths != []) or
(collectConfig.excludePatterns is not None and collectConfig.excludePatterns != [])):
excludeNode = addContainerNode(xmlDom, sectionNode, "exclude")
@@ -5694,10 +5730,10 @@
"""
Validates collect configuration.
- The target directory must be filled in. The collect mode, archive mode
- and ignore file are all optional. The list of absolute paths to exclude
- and patterns to exclude may be either C{None} or an empty list C{[]} if
- desired.
+ The target directory must be filled in. The collect mode, archive mode,
+ ignore file, and recursion level are all optional. The list of absolute
+ paths to exclude and patterns to exclude may be either C{None} or an
+ empty list C{[]} if desired.
Each collect directory entry must contain an absolute path to collect,
and then must either be able to take collect mode, archive mode and
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2011-10-10 03:27:34 UTC (rev 1018)
@@ -33,8 +33,8 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
-COPYRIGHT = "2004-2010"
-VERSION = "2.20.1"
-DATE = "19 Oct 2010"
+COPYRIGHT = "2004-2011"
+VERSION = "2.21.0"
+DATE = "unreleased"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/Changelog 2011-10-10 03:27:34 UTC (rev 1018)
@@ -1,3 +1,10 @@
+Version 2.21.0 unreleased
+
+ * Implement configurable recursion for collect action.
+ - Update collect.py to handle recursion (patch by Zoran Bosnjak)
+ - Add new configuration item CollectDir.recursionLevel
+ - Update user manual, CREDITS, etc. for new functionality
+
Version 2.20.1 19 Oct 2010
* Fix minor formatting issues in manpages, pointed out by Debian lintian.
Modified: cedar-backup2/trunk/manual/src/config.xml
===================================================================
--- cedar-backup2/trunk/manual/src/config.xml 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/manual/src/config.xml 2011-10-10 03:27:34 UTC (rev 1018)
@@ -1366,6 +1366,53 @@
</varlistentry>
<varlistentry>
+ <term><literal>recursion_level</literal></term>
+ <listitem>
+ <para>Recursion level to use when collecting directories.</para>
+ <para>
+ This is an integer value that Cedar Backup will consider
+ when generating archive files for a configured collect
+ directory.
+ </para>
+ <para>
+ Normally, Cedar Backup generates one archive file per
+ collect directory. So, if you collect
+ <literal>/etc</literal> you get
+ <literal>etc.tar.gz</literal>. Most of the time, this is
+ what you want. However, you may sometimes wish to
+ generate multiple archive files for a single collect
+ directory.
+ </para>
+ <para>
+ The most obvious example is for <literal>/home</literal>.
+ By default, Cedar Backup will generate
+ <literal>home.tar.gz</literal>. If instead, you want one
+ archive file per home directory you can set a recursion
+ level of <literal>1</literal>. Cedar Backup will generate
+ <literal>home-user1.tar.gz</literal>,
+ <literal>home-user2.tar.gz</literal>, etc.
+ </para>
+ <para>
+ Higher recursion levels (<literal>2</literal>,
+ <literal>3</literal>, etc.) are legal, and it doesn't
+ matter if the configured recursion level is deeper than
+ the directory tree that is being collected. You can use a
+ negative recursion level (like <literal>-1</literal>) to
+ specify an infinite level of recursion. This will exhaust
+ the tree in the same way as if the recursion level is set
+ too high.
+ </para>
+ <para>
+ This field is optional. if it doesn't exist, the backup
+ will use the default list recursion level of zero.
+ </para>
+ <para>
+ <emphasis>Restrictions:</emphasis> Must be an integer.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>exclude</literal></term>
<listitem>
<para>List of paths or patterns to exclude from the backup.</para>
Modified: cedar-backup2/trunk/testcase/configtests.py
===================================================================
--- cedar-backup2/trunk/testcase/configtests.py 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/testcase/configtests.py 2011-10-10 03:27:34 UTC (rev 1018)
@@ -11256,6 +11256,7 @@
config = Config(xmlPath=path, validate=False)
expected = Config()
expected.collect = CollectConfig("/opt/backup/collect", "daily", "targz", ".cbignore")
+ expected.collect.recursionLevel = 1
expected.collect.absoluteExcludePaths = ["/etc/cback.conf", "/etc/X11", ]
expected.collect.excludePatterns = [".*tmp.*", ".*\.netscape\/.*", ]
expected.collect.collectFiles = []
Modified: cedar-backup2/trunk/testcase/data/cback.conf.8
===================================================================
--- cedar-backup2/trunk/testcase/data/cback.conf.8 2011-03-02 17:35:31 UTC (rev 1017)
+++ cedar-backup2/trunk/testcase/data/cback.conf.8 2011-10-10 03:27:34 UTC (rev 1018)
@@ -6,6 +6,7 @@
<collect_mode>daily</collect_mode>
<archive_mode>targz</archive_mode>
<ignore_file>.cbignore</ignore_file>
+ <recursion_level>1</recursion_level>
<exclude>
<abs_path>/etc/cback.conf</abs_path>
<abs_path>/etc/X11</abs_path>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2011-10-11 21:26:43
|
Revision: 1019
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1019&view=rev
Author: pronovic
Date: 2011-10-11 20:19:35 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Make ISO image tests more robust
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/testcase/writersutiltests.py
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2011-10-10 03:27:34 UTC (rev 1018)
+++ cedar-backup2/trunk/Changelog 2011-10-11 20:19:35 UTC (rev 1019)
@@ -1,5 +1,8 @@
Version 2.21.0 unreleased
+ * Make ISO image unit tests more robust in writersutiltests.py.
+ - Handle failures with unmount (wait 1 second and try again)
+ - Programmatically disable (and re-enable) the GNOME auto-mounter
* Implement configurable recursion for collect action.
- Update collect.py to handle recursion (patch by Zoran Bosnjak)
- Add new configuration item CollectDir.recursionLevel
Modified: cedar-backup2/trunk/testcase/writersutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/writersutiltests.py 2011-10-10 03:27:34 UTC (rev 1018)
+++ cedar-backup2/trunk/testcase/writersutiltests.py 2011-10-11 20:19:35 UTC (rev 1019)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010,2011 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -95,6 +95,7 @@
import os
import unittest
import tempfile
+import time
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
from CedarBackup2.testutil import platformMacOsX, platformSupportsLinks
from CedarBackup2.filesystem import FilesystemList
@@ -111,6 +112,7 @@
SUDO_CMD = [ "sudo", ]
HDIUTIL_CMD = [ "hdiutil", ]
+GCONF_CMD = [ "gconftool-2", ]
INVALID_FILE = "bogus" # This file name should never exist
@@ -331,6 +333,7 @@
def setUp(self):
try:
+ self.disableGnomeAutomount()
self.mounted = False
self.tmpdir = tempfile.mkdtemp()
self.resources = findResources(RESOURCES, DATA_DIRS)
@@ -341,6 +344,7 @@
if self.mounted:
self.unmountImage()
removedir(self.tmpdir)
+ self.enableGnomeAutomount()
##################
@@ -403,7 +407,7 @@
Note that this will fail unless the user has been granted permissions via
sudo, using something like this:
- Cmnd_Alias LOOPMOUNT = /bin/mount -t iso9660 -o loop * *
+ Cmnd_Alias LOOPMOUNT = /bin/mount -d -t iso9660 -o loop * *
Keep in mind that this entry is a security hole, so you might not want to
keep it in C{/etc/sudoers} all of the time.
@@ -460,10 +464,16 @@
"""
Unmounts an ISO image from C{self.tmpdir/mnt}.
+ Sometimes, multiple tries are needed because the ISO filesystem is still
+ in use. We try twice with a 1-second pause between attempts. If this
+ isn't successful, you may run out of loopback devices. Check for leftover
+ mounts using 'losetup -a' as root. You can remove a leftover mount using
+ something like 'losetup -d /dev/loop0'.
+
Note that this will fail unless the user has been granted permissions via
sudo, using something like this:
- Cmnd_Alias LOOPUNMOUNT = /bin/umount -t iso9660 *
+ Cmnd_Alias LOOPUNMOUNT = /bin/umount -d -t iso9660 *
Keep in mind that this entry is a security hole, so you might not want to
keep it in C{/etc/sudoers} all of the time.
@@ -474,10 +484,55 @@
args = [ "umount", "-d", "-t", "iso9660", mountPath, ]
(result, output) = executeCommand(SUDO_CMD, args, returnOutput=True)
if result != 0:
- raise IOError("Error (%d) executing command to unmount image." % result)
+ time.sleep(1)
+ (result, output) = executeCommand(SUDO_CMD, args, returnOutput=True)
+ if result != 0:
+ raise IOError("Error (%d) executing command to unmount image." % result)
self.mounted = False
+ def disableGnomeAutomount(self):
+ """
+ Disables GNOME auto-mounting of ISO volumes when full tests are enabled.
+ As of this writing (October 2011), recent versions of GNOME in Debian
+ come pre-configured to auto-mount various kinds of media (like CDs and
+ thumb drives). Besides auto-mounting the media, GNOME also often opens
+ up a Nautilus browser window to explore the newly-mounted media.
+
+ This causes lots of problems for these unit tests, which assume that they
+ have complete control over the mounting and unmounting process. So, for
+ these tests to work, we need to disable GNOME auto-mounting.
+ """
+ self.orig_media_automount = None
+ self.orig_media_automount_open = None
+ if runAllTests():
+ args = [ "--get", "/apps/nautilus/preferences/media_automount", ]
+ (result, output) = executeCommand(GCONF_CMD, args, returnOutput=True)
+ if result == 0:
+ self.orig_media_automount = output[0][:-1]
+ if self.orig_media_automount == "true":
+ args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount", "false", ]
+ executeCommand(GCONF_CMD, args)
+ args = [ "--get", "/apps/nautilus/preferences/media_automount_open", ]
+ (result, output) = executeCommand(GCONF_CMD, args, returnOutput=True)
+ if result == 0:
+ self.orig_media_automount_open = output[0][:-1] # should be either "true" or "false"
+ if self.orig_media_automount_open == "true":
+ args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount_open", "false", ]
+ executeCommand(GCONF_CMD, args)
+
+ def enableGnomeAutomount(self):
+ """
+ Resets GNOME auto-mounting options back to their state prior to disableGnomeAutomount().
+ """
+ if self.orig_media_automount == "true":
+ args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount", "true", ]
+ executeCommand(GCONF_CMD, args)
+ if self.orig_media_automount_open == "true":
+ args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount_open", "true", ]
+ executeCommand(GCONF_CMD, args)
+
+
###################
# Test constructor
###################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2011-10-11 21:48:00
|
Revision: 1020
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1020&view=rev
Author: pronovic
Date: 2011-10-11 21:47:53 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Fix my screwed-up code: recursionLevel belongs on CollectDir not CollectConfig
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/collect.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/testcase/configtests.py
cedar-backup2/trunk/testcase/data/cback.conf.8
Modified: cedar-backup2/trunk/CedarBackup2/actions/collect.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/collect.py 2011-10-11 20:19:35 UTC (rev 1019)
+++ cedar-backup2/trunk/CedarBackup2/actions/collect.py 2011-10-11 21:47:53 UTC (rev 1020)
@@ -208,7 +208,7 @@
@param excludePatterns: List of patterns to exclude.
@param recursionLevel: Recursion level (zero for no recursion)
"""
- if recursionLevel == 0:
+ if recursionLevel == 0:
# Collect the actual directory because we're at recursion level 0
logger.info("Collecting directory [%s]" % absolutePath)
tarfilePath = _getTarfilePath(config, absolutePath, archiveMode)
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2011-10-11 20:19:35 UTC (rev 1019)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2011-10-11 21:47:53 UTC (rev 1020)
@@ -1312,7 +1312,7 @@
def __init__(self, absolutePath=None, collectMode=None, archiveMode=None, ignoreFile=None,
absoluteExcludePaths=None, relativeExcludePaths=None, excludePatterns=None,
- linkDepth=None, dereference=False):
+ linkDepth=None, dereference=False, recursionLevel=None):
"""
Constructor for the C{CollectDir} class.
@@ -1334,6 +1334,7 @@
self._ignoreFile = None
self._linkDepth = None
self._dereference = None
+ self._recursionLevel = None
self._absoluteExcludePaths = None
self._relativeExcludePaths = None
self._excludePatterns = None
@@ -1343,6 +1344,7 @@
self.ignoreFile = ignoreFile
self.linkDepth = linkDepth
self.dereference = dereference
+ self.recursionLevel = recursionLevel
self.absoluteExcludePaths = absoluteExcludePaths
self.relativeExcludePaths = relativeExcludePaths
self.excludePatterns = excludePatterns
@@ -1351,12 +1353,13 @@
"""
Official string representation for class instance.
"""
- return "CollectDir(%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.absolutePath, self.collectMode,
- self.archiveMode, self.ignoreFile,
- self.absoluteExcludePaths,
- self.relativeExcludePaths,
- self.excludePatterns,
- self.linkDepth, self.dereference)
+ return "CollectDir(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.absolutePath, self.collectMode,
+ self.archiveMode, self.ignoreFile,
+ self.absoluteExcludePaths,
+ self.relativeExcludePaths,
+ self.excludePatterns,
+ self.linkDepth, self.dereference,
+ self.recursionLevel)
def __str__(self):
"""
@@ -1403,6 +1406,11 @@
return -1
else:
return 1
+ if self.recursionLevel != other.recursionLevel:
+ if self.recursionLevel < other.recursionLevel:
+ return -1
+ else:
+ return 1
if self.absoluteExcludePaths != other.absoluteExcludePaths:
if self.absoluteExcludePaths < other.absoluteExcludePaths:
return -1
@@ -1529,6 +1537,27 @@
"""
return self._dereference
+ def _setRecursionLevel(self, value):
+ """
+ Property target used to set the recursionLevel.
+ The value must be an integer.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is None:
+ self._recursionLevel = None
+ else:
+ try:
+ value = int(value)
+ except TypeError:
+ raise ValueError("Recusion level value must be an integer.")
+ self._recursionLevel = value
+
+ def _getRecursionLevel(self):
+ """
+ Property target used to get the action recursionLevel.
+ """
+ return self._recursionLevel
+
def _setAbsoluteExcludePaths(self, value):
"""
Property target used to set the absolute exclude paths list.
@@ -1602,6 +1631,7 @@
ignoreFile = property(_getIgnoreFile, _setIgnoreFile, None, doc="Overridden ignore file name for this directory.")
linkDepth = property(_getLinkDepth, _setLinkDepth, None, doc="Maximum at which soft links should be followed.")
dereference = property(_getDereference, _setDereference, None, doc="Whether to dereference links that are followed.")
+ recursionLevel = property(_getRecursionLevel, _setRecursionLevel, None, "Recursion level to use for recursive directory collection")
absoluteExcludePaths = property(_getAbsoluteExcludePaths, _setAbsoluteExcludePaths, None, "List of absolute paths to exclude.")
relativeExcludePaths = property(_getRelativeExcludePaths, _setRelativeExcludePaths, None, "List of relative paths to exclude.")
excludePatterns = property(_getExcludePatterns, _setExcludePatterns, None, "List of regular expression patterns to exclude.")
@@ -2934,12 +2964,12 @@
@sort: __init__, __repr__, __str__, __cmp__, targetDir,
collectMode, archiveMode, ignoreFile, absoluteExcludePaths,
- excludePatterns, collectFiles, collectDirs, recursionLevel
+ excludePatterns, collectFiles, collectDirs
"""
def __init__(self, targetDir=None, collectMode=None, archiveMode=None, ignoreFile=None,
absoluteExcludePaths=None, excludePatterns=None, collectFiles=None,
- collectDirs=None, recursionLevel=None):
+ collectDirs=None):
"""
Constructor for the C{CollectConfig} class.
@@ -2951,7 +2981,6 @@
@param excludePatterns: List of regular expression patterns to exclude.
@param collectFiles: List of collect files.
@param collectDirs: List of collect directories.
- @param recursionLevel: Recursion level to use for recursive directory collection
@raise ValueError: If one of the values is invalid.
"""
@@ -2963,7 +2992,6 @@
self._excludePatterns = None
self._collectFiles = None
self._collectDirs = None
- self._recursionLevel = None
self.targetDir = targetDir
self.collectMode = collectMode
self.archiveMode = archiveMode
@@ -2972,16 +3000,14 @@
self.excludePatterns = excludePatterns
self.collectFiles = collectFiles
self.collectDirs = collectDirs
- self.recursionLevel = recursionLevel
def __repr__(self):
"""
Official string representation for class instance.
"""
- return "CollectConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.targetDir, self.collectMode, self.archiveMode,
- self.ignoreFile, self.absoluteExcludePaths,
- self.excludePatterns, self.collectFiles,
- self.collectDirs, self.recursionLevel)
+ return "CollectConfig(%s, %s, %s, %s, %s, %s, %s, %s)" % (self.targetDir, self.collectMode, self.archiveMode,
+ self.ignoreFile, self.absoluteExcludePaths,
+ self.excludePatterns, self.collectFiles, self.collectDirs)
def __str__(self):
"""
@@ -3038,11 +3064,6 @@
return -1
else:
return 1
- if self.recursionLevel != other.recursionLevel:
- if self.recursionLevel < other.recursionLevel:
- return -1
- else:
- return 1
return 0
def _setTargetDir(self, value):
@@ -3207,27 +3228,6 @@
"""
return self._collectDirs
- def _setRecursionLevel(self, value):
- """
- Property target used to set the recursionLevel.
- The value must be an integer.
- @raise ValueError: If the value is not valid.
- """
- if value is None:
- self._recursionLevel = None
- else:
- try:
- value = int(value)
- except TypeError:
- raise ValueError("Recusion level value must be an integer.")
- self._recursionLevel = value
-
- def _getRecursionLevel(self):
- """
- Property target used to get the action recursionLevel.
- """
- return self._recursionLevel
-
targetDir = property(_getTargetDir, _setTargetDir, None, "Directory to collect files into.")
collectMode = property(_getCollectMode, _setCollectMode, None, "Default collect mode.")
archiveMode = property(_getArchiveMode, _setArchiveMode, None, "Default archive mode for collect files.")
@@ -3236,7 +3236,6 @@
excludePatterns = property(_getExcludePatterns, _setExcludePatterns, None, "List of regular expressions patterns to exclude.")
collectFiles = property(_getCollectFiles, _setCollectFiles, None, "List of collect files.")
collectDirs = property(_getCollectDirs, _setCollectDirs, None, "List of collect directories.")
- recursionLevel = property(_getRecursionLevel, _setRecursionLevel, None, "Recursion level to use for recursive directory collection")
########################################################################
@@ -4485,7 +4484,6 @@
collectMode //cb_config/collect/collect_mode
archiveMode //cb_config/collect/archive_mode
ignoreFile //cb_config/collect/ignore_file
- recursionLevel //cb_config/collect/recursion_level
We also read groups of the following items, one list element per
item::
@@ -4512,7 +4510,6 @@
collect.collectMode = readString(sectionNode, "collect_mode")
collect.archiveMode = readString(sectionNode, "archive_mode")
collect.ignoreFile = readString(sectionNode, "ignore_file")
- collect.recursionLevel = readInteger(sectionNode, "recursion_level")
(collect.absoluteExcludePaths, unused, collect.excludePatterns) = Config._parseExclusions(sectionNode)
collect.collectFiles = Config._parseCollectFiles(sectionNode)
collect.collectDirs = Config._parseCollectDirs(sectionNode)
@@ -4787,6 +4784,7 @@
ignoreFile ignore_file
linkDepth link_depth
dereference dereference
+ recursionLevel recursion_level
The collect mode is a special case. Just a C{mode} tag is accepted for
backwards compatibility, but we prefer C{collect_mode} for consistency
@@ -4819,6 +4817,7 @@
cdir.ignoreFile = readString(entry, "ignore_file")
cdir.linkDepth = readInteger(entry, "link_depth")
cdir.dereference = readBoolean(entry, "dereference")
+ cdir.recursionLevel = readInteger(entry, "recursion_level")
(cdir.absoluteExcludePaths, cdir.relativeExcludePaths, cdir.excludePatterns) = Config._parseExclusions(entry)
lst.append(cdir)
if lst == []:
@@ -5144,7 +5143,6 @@
collectMode //cb_config/collect/collect_mode
archiveMode //cb_config/collect/archive_mode
ignoreFile //cb_config/collect/ignore_file
- recursionLevel //cb_config/collect/recursion_level
We also add groups of the following items, one list element per
item::
@@ -5169,7 +5167,6 @@
addStringNode(xmlDom, sectionNode, "collect_mode", collectConfig.collectMode)
addStringNode(xmlDom, sectionNode, "archive_mode", collectConfig.archiveMode)
addStringNode(xmlDom, sectionNode, "ignore_file", collectConfig.ignoreFile)
- addStringNode(xmlDom, sectionNode, "recursion_level", collectConfig.recursionLevel)
if ((collectConfig.absoluteExcludePaths is not None and collectConfig.absoluteExcludePaths != []) or
(collectConfig.excludePatterns is not None and collectConfig.excludePatterns != [])):
excludeNode = addContainerNode(xmlDom, sectionNode, "exclude")
@@ -5422,6 +5419,7 @@
ignoreFile dir/ignore_file
linkDepth dir/link_depth
dereference dir/dereference
+ recursionLevel dir/recursion_level
Note that an original XML document might have listed the collect mode
using the C{mode} tag, since we accept both C{collect_mode} and C{mode}.
@@ -5451,6 +5449,7 @@
addStringNode(xmlDom, sectionNode, "ignore_file", collectDir.ignoreFile)
addIntegerNode(xmlDom, sectionNode, "link_depth", collectDir.linkDepth)
addBooleanNode(xmlDom, sectionNode, "dereference", collectDir.dereference)
+ addIntegerNode(xmlDom, sectionNode, "recursion_level", collectDir.recursionLevel)
if ((collectDir.absoluteExcludePaths is not None and collectDir.absoluteExcludePaths != []) or
(collectDir.relativeExcludePaths is not None and collectDir.relativeExcludePaths != []) or
(collectDir.excludePatterns is not None and collectDir.excludePatterns != [])):
Modified: cedar-backup2/trunk/testcase/configtests.py
===================================================================
--- cedar-backup2/trunk/testcase/configtests.py 2011-10-11 20:19:35 UTC (rev 1019)
+++ cedar-backup2/trunk/testcase/configtests.py 2011-10-11 21:47:53 UTC (rev 1020)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010,2011 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -2439,6 +2439,7 @@
self.failUnlessEqual(None, collectDir.ignoreFile)
self.failUnlessEqual(None, collectDir.linkDepth)
self.failUnlessEqual(False, collectDir.dereference)
+ self.failUnlessEqual(None, collectDir.recursionLevel)
self.failUnlessEqual(None, collectDir.absoluteExcludePaths)
self.failUnlessEqual(None, collectDir.relativeExcludePaths)
self.failUnlessEqual(None, collectDir.excludePatterns)
@@ -2447,13 +2448,14 @@
"""
Test constructor with all values filled in, with valid values.
"""
- collectDir = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 2, True)
+ collectDir = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 2, True, 6)
self.failUnlessEqual("/etc/whatever", collectDir.absolutePath)
self.failUnlessEqual("incr", collectDir.collectMode)
self.failUnlessEqual("tar", collectDir.archiveMode)
self.failUnlessEqual(".ignore", collectDir.ignoreFile)
self.failUnlessEqual(2, collectDir.linkDepth)
self.failUnlessEqual(True, collectDir.dereference)
+ self.failUnlessEqual(6, collectDir.recursionLevel)
self.failUnlessEqual([], collectDir.absoluteExcludePaths)
self.failUnlessEqual([], collectDir.relativeExcludePaths)
self.failUnlessEqual([], collectDir.excludePatterns)
@@ -2845,7 +2847,34 @@
collectDir.dereference = 3
self.failUnlessEqual(True, collectDir.dereference)
+ def testConstructor_042(self):
+ """
+ Test assignment of recursionLevel attribute, None value.
+ """
+ collectDir = CollectDir(recursionLevel=1)
+ self.failUnlessEqual(1, collectDir.recursionLevel)
+ collectDir.recursionLevel = None
+ self.failUnlessEqual(None, collectDir.recursionLevel)
+ def testConstructor_043(self):
+ """
+ Test assignment of recursionLevel attribute, valid value.
+ """
+ collectDir = CollectDir()
+ self.failUnlessEqual(None, collectDir.recursionLevel)
+ collectDir.recursionLevel = 1
+ self.failUnlessEqual(1, collectDir.recursionLevel)
+
+ def testConstructor_044(self):
+ """
+ Test assignment of recursionLevel attribute, invalid value.
+ """
+ collectDir = CollectDir()
+ self.failUnlessEqual(None, collectDir.recursionLevel)
+ self.failUnlessAssignRaises(ValueError, collectDir, "recursionLevel", "ken")
+ self.failUnlessEqual(None, collectDir.recursionLevel)
+
+
############################
# Test comparison operators
############################
@@ -2869,8 +2898,8 @@
Test comparison of two identical objects, all attributes non-None (empty
lists).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
self.failUnless(collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
self.failUnless(collectDir1 <= collectDir2)
@@ -2883,8 +2912,8 @@
Test comparison of two identical objects, all attributes non-None
(non-empty lists).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/one", ], ["two", ], ["three", ], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/one", ], ["two", ], ["three", ], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/one", ], ["two", ], ["three", ], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/one", ], ["two", ], ["three", ], 1, True, 6)
self.failUnless(collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
self.failUnless(collectDir1 <= collectDir2)
@@ -2910,8 +2939,8 @@
"""
Test comparison of two differing objects, absolutePath differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/stuff", "incr", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/stuff", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -2938,8 +2967,8 @@
"""
Test comparison of two differing objects, collectMode differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "daily", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "daily", "tar", ".ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -2966,8 +2995,8 @@
"""
Test comparison of two differing objects, archiveMode differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "targz", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "targz", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -2994,8 +3023,8 @@
"""
Test comparison of two differing objects, ignoreFile differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -3039,8 +3068,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(one empty, one not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/whatever", ], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/whatever", ], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -3054,8 +3083,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(both not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/stuff", ], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/stuff", "/something", ], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/stuff", ], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/stuff", "/something", ], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2) # note: different than standard due to unsorted list
@@ -3099,8 +3128,8 @@
Test comparison of two differing objects, relativeExcludePaths differs
(one empty, one not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["one", ], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["one", ], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -3114,8 +3143,8 @@
Test comparison of two differing objects, relativeExcludePaths differs
(both not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["one", ], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["two", ], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["one", ], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], ["two", ], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -3159,8 +3188,8 @@
Test comparison of two differing objects, excludePatterns differs (one
empty, one not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["pattern", ], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["pattern", ], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -3174,8 +3203,8 @@
Test comparison of two differing objects, excludePatterns differs (both
not empty).
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["p1", ], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["p2", ], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["p1", ], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", [], [], ["p2", ], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -3202,8 +3231,8 @@
"""
Test comparison of two differing objects, linkDepth differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 2, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 2, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -3230,8 +3259,8 @@
"""
Test comparison of two differing objects, dereference differs.
"""
- collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True)
- collectDir2 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, False)
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, False, 6)
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
@@ -3240,7 +3269,35 @@
self.failUnless(collectDir1 >= collectDir2)
self.failUnless(collectDir1 != collectDir2)
+ def testComparison_028(self):
+ """
+ Test comparison of two differing objects, recursionLevel differs (one None).
+ """
+ collectDir1 = CollectDir()
+ collectDir2 = CollectDir(recursionLevel=1)
+ self.failIfEqual(collectDir1, collectDir2)
+ self.failUnless(not collectDir1 == collectDir2)
+ self.failUnless(collectDir1 < collectDir2)
+ self.failUnless(collectDir1 <= collectDir2)
+ self.failUnless(not collectDir1 > collectDir2)
+ self.failUnless(not collectDir1 >= collectDir2)
+ self.failUnless(collectDir1 != collectDir2)
+ def testComparison_029(self):
+ """
+ Test comparison of two differing objects, recursionLevel differs.
+ """
+ collectDir1 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True, 6)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", "ignore", [], [], [], 1, True, 5)
+ self.failIfEqual(collectDir1, collectDir2)
+ self.failUnless(not collectDir1 == collectDir2)
+ self.failUnless(not collectDir1 < collectDir2)
+ self.failUnless(not collectDir1 <= collectDir2)
+ self.failUnless(collectDir1 > collectDir2)
+ self.failUnless(collectDir1 >= collectDir2)
+ self.failUnless(collectDir1 != collectDir2)
+
+
#####################
# TestPurgeDir class
#####################
@@ -11256,7 +11313,6 @@
config = Config(xmlPath=path, validate=False)
expected = Config()
expected.collect = CollectConfig("/opt/backup/collect", "daily", "targz", ".cbignore")
- expected.collect.recursionLevel = 1
expected.collect.absoluteExcludePaths = ["/etc/cback.conf", "/etc/X11", ]
expected.collect.excludePatterns = [".*tmp.*", ".*\.netscape\/.*", ]
expected.collect.collectFiles = []
@@ -11264,7 +11320,7 @@
expected.collect.collectFiles.append(CollectFile(absolutePath="/home/root/.kshrc", collectMode="weekly"))
expected.collect.collectFiles.append(CollectFile(absolutePath="/home/root/.aliases", collectMode="daily", archiveMode="tarbz2"))
expected.collect.collectDirs = []
- expected.collect.collectDirs.append(CollectDir(absolutePath="/root"))
+ expected.collect.collectDirs.append(CollectDir(absolutePath="/root", recursionLevel=1))
expected.collect.collectDirs.append(CollectDir(absolutePath="/tmp", linkDepth=3))
expected.collect.collectDirs.append(CollectDir(absolutePath="/ken", linkDepth=1, dereference=True))
expected.collect.collectDirs.append(CollectDir(absolutePath="/var/log", collectMode="incr"))
Modified: cedar-backup2/trunk/testcase/data/cback.conf.8
===================================================================
--- cedar-backup2/trunk/testcase/data/cback.conf.8 2011-10-11 20:19:35 UTC (rev 1019)
+++ cedar-backup2/trunk/testcase/data/cback.conf.8 2011-10-11 21:47:53 UTC (rev 1020)
@@ -6,7 +6,6 @@
<collect_mode>daily</collect_mode>
<archive_mode>targz</archive_mode>
<ignore_file>.cbignore</ignore_file>
- <recursion_level>1</recursion_level>...
[truncated message content] |
|
From: <pro...@us...> - 2011-10-11 23:27:56
|
Revision: 1022
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1022&view=rev
Author: pronovic
Date: 2011-10-11 23:27:49 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Update pylint configuration for new version
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/action.py
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/extend/mysql.py
cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/image.py
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/CedarBackup2/writer.py
cedar-backup2/trunk/CedarBackup2/xmlutil.py
cedar-backup2/trunk/pylint-code.rc
cedar-backup2/trunk/pylint-test.rc
cedar-backup2/trunk/setup.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/util/createtree.py
cedar-backup2/trunk/util/sorttags.py
Modified: cedar-backup2/trunk/CedarBackup2/action.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/action.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/action.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -35,7 +35,7 @@
# Imported modules
########################################################################
-# pylint: disable-msg=W0611
+# pylint: disable=W0611
from CedarBackup2.actions.collect import executeCollect
from CedarBackup2.actions.stage import executeStage
from CedarBackup2.actions.store import executeStore
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -377,7 +377,7 @@
logger.debug("Calling action function [%s], execution index [%d]" % (name, self.index))
self.function(configPath, options, config)
- def _executeHook(self, type, hook): # pylint: disable-msg=W0622,R0201
+ def _executeHook(self, type, hook): # pylint: disable=W0622,R0201
"""
Executes a hook command via L{util.executeCommand()}.
@param type: String describing the type of hook, for logging.
Modified: cedar-backup2/trunk/CedarBackup2/extend/mysql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -129,7 +129,7 @@
@sort: __init__, __repr__, __str__, __cmp__, user, password, all, databases
"""
- def __init__(self, user=None, password=None, compressMode=None, all=None, databases=None): # pylint: disable-msg=W0622
+ def __init__(self, user=None, password=None, compressMode=None, all=None, databases=None): # pylint: disable=W0622
"""
Constructor for the C{MysqlConfig} class.
Modified: cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -120,7 +120,7 @@
@sort: __init__, __repr__, __str__, __cmp__, user, all, databases
"""
- def __init__(self, user=None, compressMode=None, all=None, databases=None): # pylint: disable-msg=W0622
+ def __init__(self, user=None, compressMode=None, all=None, databases=None): # pylint: disable=W0622
"""
Constructor for the C{PostgresqlConfig} class.
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -724,7 +724,7 @@
# SpanItem class definition
########################################################################
-class SpanItem(object): # pylint: disable-msg=R0903
+class SpanItem(object): # pylint: disable=R0903
"""
Item returned by L{BackupFileList.generateSpan}.
"""
@@ -745,7 +745,7 @@
# BackupFileList class definition
########################################################################
-class BackupFileList(FilesystemList): # pylint: disable-msg=R0904
+class BackupFileList(FilesystemList): # pylint: disable=R0904
######################
# Class documentation
@@ -911,7 +911,7 @@
@return: ASCII-safe SHA digest for the file.
@raise OSError: If the file cannot be opened.
"""
- # pylint: disable-msg=C0103
+ # pylint: disable=C0103
try:
import hashlib
s = hashlib.sha1()
@@ -1097,7 +1097,7 @@
@raise ValueError: If the path could not be encoded properly.
@raise TarError: If there is a problem creating the tar file
"""
- # pylint: disable-msg=E1101
+ # pylint: disable=E1101
path = encodePath(path)
if len(self) == 0: raise ValueError("Empty list cannot be used to generate tarfile.")
if(mode == 'tar'): tarmode = "w:"
@@ -1228,7 +1228,7 @@
# PurgeItemList class definition
########################################################################
-class PurgeItemList(FilesystemList): # pylint: disable-msg=R0904
+class PurgeItemList(FilesystemList): # pylint: disable=R0904
######################
# Class documentation
Modified: cedar-backup2/trunk/CedarBackup2/image.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/image.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/image.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -35,5 +35,5 @@
# Imported modules
########################################################################
-from CedarBackup2.writers.util import IsoImage # pylint: disable-msg=W0611
+from CedarBackup2.writers.util import IsoImage # pylint: disable=W0611
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -70,7 +70,7 @@
import time
import getpass
import random
-import string # pylint: disable-msg=W0402
+import string # pylint: disable=W0402
import platform
import logging
from StringIO import StringIO
@@ -234,7 +234,7 @@
@param filepath: Path to tarfile to extract.
@raise ValueError: If a path cannot be encoded properly.
"""
- # pylint: disable-msg=E1101
+ # pylint: disable=E1101
tmpdir = encodePath(tmpdir)
filepath = encodePath(filepath)
tar = tarfile.open(filepath)
@@ -366,7 +366,7 @@
missed = False
instead = None
try:
- exec "obj.%s = value" % prop # pylint: disable-msg=W0122
+ exec "obj.%s = value" % prop # pylint: disable=W0122
missed = True
except exception: pass
except Exception, e: instead = e
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -83,7 +83,7 @@
import re
import time
import logging
-import string # pylint: disable-msg=W0402
+import string # pylint: disable=W0402
from subprocess import Popen, STDOUT, PIPE
from CedarBackup2.release import VERSION, DATE
@@ -639,7 +639,7 @@
@param other: Other object to compare to.
@return: -1/0/1 depending on whether self is C{<}, C{=} or C{>} other.
"""
- # pylint: disable-msg=W0212
+ # pylint: disable=W0212
if other is None:
return 1
if self.name != other.name:
@@ -803,7 +803,7 @@
def __init__(self):
pass
def __call__(self, *args, **kw):
- # pylint: disable-msg=W0212,R0201
+ # pylint: disable=W0212,R0201
if PathResolverSingleton._instance is None:
obj = PathResolverSingleton()
PathResolverSingleton._instance = obj
@@ -878,7 +878,7 @@
@sort: __init__, __repr__, __str__
"""
- # pylint: disable-msg=R0201
+ # pylint: disable=R0201
def __init__(self):
"""
@@ -988,7 +988,7 @@
try:
if sys.platform.startswith("win"):
windowsPlatforms = [ "Windows 3.1", "Windows 95/98/ME", "Windows NT/2000/XP", "Windows CE", ]
- wininfo = sys.getwindowsversion() # pylint: disable-msg=E1101
+ wininfo = sys.getwindowsversion() # pylint: disable=E1101
winversion = "%d.%d.%d" % (wininfo[0], wininfo[1], wininfo[2])
winplatform = windowsPlatforms[wininfo[3]]
wintext = wininfo[4] # i.e. "Service Pack 2"
Modified: cedar-backup2/trunk/CedarBackup2/writer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writer.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/writer.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -35,7 +35,7 @@
# Imported modules
########################################################################
-# pylint: disable-msg=W0611
+# pylint: disable=W0611
from CedarBackup2.writers.util import validateScsiId, validateDriveSpeed
from CedarBackup2.writers.cdwriter import MediaDefinition, MediaCapacity, CdWriter
from CedarBackup2.writers.cdwriter import MEDIA_CDRW_74, MEDIA_CDR_74, MEDIA_CDRW_80, MEDIA_CDR_80
Modified: cedar-backup2/trunk/CedarBackup2/xmlutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/xmlutil.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/CedarBackup2/xmlutil.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -58,7 +58,7 @@
@author: Kenneth J. Pronovici <pro...@ie...>
"""
-# pylint: disable-msg=C0111,C0103,W0511,W0104
+# pylint: disable=C0111,C0103,W0511,W0104
########################################################################
# Imported modules
Modified: cedar-backup2/trunk/pylint-code.rc
===================================================================
--- cedar-backup2/trunk/pylint-code.rc 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/pylint-code.rc 2011-10-11 23:27:49 UTC (rev 1022)
@@ -70,7 +70,7 @@
#enable-msg=
# Disable the message(s) with the given id(s).
-disable-msg=I0011,W0702,W0703,W0704,C0302,C0321,R0902,R0911,R0912,R0913,R0914,R0915
+disable=I0011,W0702,W0703,W0704,C0302,C0321,R0902,R0911,R0912,R0913,R0914,R0915
[REPORTS]
Modified: cedar-backup2/trunk/pylint-test.rc
===================================================================
--- cedar-backup2/trunk/pylint-test.rc 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/pylint-test.rc 2011-10-11 23:27:49 UTC (rev 1022)
@@ -73,7 +73,7 @@
#enable-msg=
# Disable the message(s) with the given id(s).
-disable-msg=I0011,W0212,W0702,W0703,W0704,C0302,C0301,C0321,C0111,R0201,R0902,R0904,R0911,R0912,R0913,R0914,R0915
+disable=I0011,W0212,W0702,W0703,W0704,C0302,C0301,C0321,C0111,R0201,R0902,R0904,R0911,R0912,R0913,R0914,R0915
[REPORTS]
Modified: cedar-backup2/trunk/setup.py
===================================================================
--- cedar-backup2/trunk/setup.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/setup.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -17,7 +17,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# pylint: disable-msg=C0111
+# pylint: disable=C0111
########################################################################
# Imported modules
Modified: cedar-backup2/trunk/testcase/utiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/utiltests.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/testcase/utiltests.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -32,7 +32,7 @@
# Purpose : Tests utility functionality.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# pylint: disable-msg=C0322,C0324
+# pylint: disable=C0322,C0324
########################################################################
# Module documentation
@@ -2057,7 +2057,7 @@
"""
Test the locale attribute.
"""
- # pylint: disable-msg=W0104
+ # pylint: disable=W0104
diagnostics = Diagnostics()
diagnostics.locale # might not be set, so just make sure method doesn't fail
Modified: cedar-backup2/trunk/util/createtree.py
===================================================================
--- cedar-backup2/trunk/util/createtree.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/util/createtree.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -99,7 +99,7 @@
import sys
import os
-import string # pylint: disable-msg=W0402
+import string # pylint: disable=W0402
import random
from ConfigParser import SafeConfigParser
Modified: cedar-backup2/trunk/util/sorttags.py
===================================================================
--- cedar-backup2/trunk/util/sorttags.py 2011-10-11 22:44:17 UTC (rev 1021)
+++ cedar-backup2/trunk/util/sorttags.py 2011-10-11 23:27:49 UTC (rev 1022)
@@ -2,7 +2,7 @@
# 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
+# pylint: disable=C0111,C0103
import sys
import re
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2011-10-11 23:44:57
|
Revision: 1023
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1023&view=rev
Author: pronovic
Date: 2011-10-11 23:44:50 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Handle Pylint warnings
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/extend/split.py
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/testcase/writersutiltests.py
Modified: cedar-backup2/trunk/CedarBackup2/extend/split.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/split.py 2011-10-11 23:27:49 UTC (rev 1022)
+++ cedar-backup2/trunk/CedarBackup2/extend/split.py 2011-10-11 23:44:50 UTC (rev 1023)
@@ -475,7 +475,7 @@
dirname = os.path.dirname(sourcePath)
filename = os.path.basename(sourcePath)
prefix = "%s_" % filename
- bytes = int(splitSize.bytes)
+ bytes = int(splitSize.bytes) # pylint: disable=W0622
os.chdir(dirname) # need to operate from directory that we want files written to
command = resolveCommand(SPLIT_COMMAND)
args = [ "--verbose", "--numeric-suffixes", "--suffix-length=5", "--bytes=%d" % bytes, filename, prefix, ]
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2011-10-11 23:27:49 UTC (rev 1022)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2011-10-11 23:44:50 UTC (rev 1023)
@@ -369,7 +369,8 @@
exec "obj.%s = value" % prop # pylint: disable=W0122
missed = True
except exception: pass
- except Exception, e: instead = e
+ except Exception, e:
+ instead = e
if missed:
testCase.fail("Expected assignment to raise %s, but got no exception." % (exception.__name__))
if instead is not None:
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2011-10-11 23:27:49 UTC (rev 1022)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2011-10-11 23:44:50 UTC (rev 1023)
@@ -1134,7 +1134,7 @@
# displayBytes() function
##########################
-def displayBytes(bytes, digits=2):
+def displayBytes(bytes, digits=2): # pylint: disable=W0622
"""
Format a byte quantity so it can be sensibly displayed.
@@ -1167,18 +1167,18 @@
raise ValueError("Cannot display byte value of None.")
bytes = float(bytes)
if math.fabs(bytes) < BYTES_PER_KBYTE:
- format = "%.0f bytes"
+ fmt = "%.0f bytes"
value = bytes
elif math.fabs(bytes) < BYTES_PER_MBYTE:
- format = "%." + "%d" % digits + "f kB"
+ fmt = "%." + "%d" % digits + "f kB"
value = bytes / BYTES_PER_KBYTE
elif math.fabs(bytes) < BYTES_PER_GBYTE:
- format = "%." + "%d" % digits + "f MB"
+ fmt = "%." + "%d" % digits + "f MB"
value = bytes / BYTES_PER_MBYTE
else:
- format = "%." + "%d" % digits + "f GB"
+ fmt = "%." + "%d" % digits + "f GB"
value = bytes / BYTES_PER_GBYTE
- return format % value
+ return fmt % value
##################################
Modified: cedar-backup2/trunk/testcase/utiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/utiltests.py 2011-10-11 23:27:49 UTC (rev 1022)
+++ cedar-backup2/trunk/testcase/utiltests.py 2011-10-11 23:44:50 UTC (rev 1023)
@@ -3534,7 +3534,7 @@
"""
Test display for a positive value < 1 KB
"""
- bytes = 12
+ bytes = 12 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("12 bytes", result)
result = displayBytes(bytes, 3)
@@ -3544,7 +3544,7 @@
"""
Test display for a negative value < 1 KB
"""
- bytes = -12
+ bytes = -12 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("-12 bytes", result)
result = displayBytes(bytes, 3)
@@ -3554,7 +3554,7 @@
"""
Test display for a positive value = 1kB
"""
- bytes = 1024
+ bytes = 1024 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("1.00 kB", result)
result = displayBytes(bytes, 3)
@@ -3564,7 +3564,7 @@
"""
Test display for a positive value >= 1kB
"""
- bytes = 5678
+ bytes = 5678 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("5.54 kB", result)
result = displayBytes(bytes, 3)
@@ -3574,7 +3574,7 @@
"""
Test display for a negative value >= 1kB
"""
- bytes = -5678
+ bytes = -5678 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("-5.54 kB", result)
result = displayBytes(bytes, 3)
@@ -3584,7 +3584,7 @@
"""
Test display for a positive value = 1MB
"""
- bytes = 1024.0 * 1024.0
+ bytes = 1024.0 * 1024.0 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("1.00 MB", result)
result = displayBytes(bytes, 3)
@@ -3594,7 +3594,7 @@
"""
Test display for a positive value >= 1MB
"""
- bytes = 72372224
+ bytes = 72372224 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("69.02 MB", result)
result = displayBytes(bytes, 3)
@@ -3604,7 +3604,7 @@
"""
Test display for a negative value >= 1MB
"""
- bytes = -72372224.0
+ bytes = -72372224.0 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("-69.02 MB", result)
result = displayBytes(bytes, 3)
@@ -3614,7 +3614,7 @@
"""
Test display for a positive value = 1GB
"""
- bytes = 1024.0 * 1024.0 * 1024.0
+ bytes = 1024.0 * 1024.0 * 1024.0 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("1.00 GB", result)
result = displayBytes(bytes, 3)
@@ -3624,7 +3624,7 @@
"""
Test display for a positive value >= 1GB
"""
- bytes = 4.4 * 1024.0 * 1024.0 * 1024.0
+ bytes = 4.4 * 1024.0 * 1024.0 * 1024.0 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("4.40 GB", result)
result = displayBytes(bytes, 3)
@@ -3634,7 +3634,7 @@
"""
Test display for a negative value >= 1GB
"""
- bytes = -1234567891011
+ bytes = -1234567891011 # pylint: disable=W0622
result = displayBytes(bytes)
self.failUnlessEqual("-1149.78 GB", result)
result = displayBytes(bytes, 3)
@@ -3644,14 +3644,14 @@
"""
Test display with an invalid quantity (None).
"""
- bytes = None
+ bytes = None # pylint: disable=W0622
self.failUnlessRaises(ValueError, displayBytes, bytes)
def testDisplayBytes_013(self):
"""
Test display with an invalid quantity (not a floating point).
"""
- bytes = "ken"
+ bytes = "ken" # pylint: disable=W0622
self.failUnlessRaises(ValueError, displayBytes, bytes)
Modified: cedar-backup2/trunk/testcase/writersutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/writersutiltests.py 2011-10-11 23:27:49 UTC (rev 1022)
+++ cedar-backup2/trunk/testcase/writersutiltests.py 2011-10-11 23:44:50 UTC (rev 1023)
@@ -503,21 +503,21 @@
have complete control over the mounting and unmounting process. So, for
these tests to work, we need to disable GNOME auto-mounting.
"""
- self.orig_media_automount = None
- self.orig_media_automount_open = None
+ self.origMediaAutomount = None
+ self.origMediaAutomountOpen = None
if runAllTests():
args = [ "--get", "/apps/nautilus/preferences/media_automount", ]
(result, output) = executeCommand(GCONF_CMD, args, returnOutput=True)
if result == 0:
- self.orig_media_automount = output[0][:-1]
- if self.orig_media_automount == "true":
+ self.origMediaAutomount = output[0][:-1] # pylint: disable=W0201
+ if self.origMediaAutomount == "true":
args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount", "false", ]
executeCommand(GCONF_CMD, args)
args = [ "--get", "/apps/nautilus/preferences/media_automount_open", ]
(result, output) = executeCommand(GCONF_CMD, args, returnOutput=True)
if result == 0:
- self.orig_media_automount_open = output[0][:-1] # should be either "true" or "false"
- if self.orig_media_automount_open == "true":
+ self.origMediaAutomountOpen = output[0][:-1] # pylint: disable=W0201
+ if self.origMediaAutomountOpen == "true":
args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount_open", "false", ]
executeCommand(GCONF_CMD, args)
@@ -525,10 +525,10 @@
"""
Resets GNOME auto-mounting options back to their state prior to disableGnomeAutomount().
"""
- if self.orig_media_automount == "true":
+ if self.origMediaAutomount == "true":
args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount", "true", ]
executeCommand(GCONF_CMD, args)
- if self.orig_media_automount_open == "true":
+ if self.origMediaAutomountOpen == "true":
args = [ "--type", "bool", "--set", "/apps/nautilus/preferences/media_automount_open", "true", ]
executeCommand(GCONF_CMD, args)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|