cedar-backup-svn Mailing List for Cedar Backup (Page 5)
Brought to you by:
pronovic
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(50) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(5) |
Mar
(55) |
Apr
(13) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(3) |
Dec
(3) |
| 2009 |
Jan
|
Feb
|
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(14) |
Feb
(2) |
Mar
|
Apr
|
May
(7) |
Jun
(8) |
Jul
(30) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(48) |
Nov
(1) |
Dec
|
| 2015 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
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: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: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: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 +885,8 @@
subversion.repositories = LocalConfig._parseRepositories(section)
subversion.repositoryDirs = LocalConfig._parseRepositoryDirs(section)
return subversion
- _parseSubversion = staticmethod(_parseSubversion)
+ @staticmethod
def _parseRepositories(parent):
"""
Reads a list of C{Repository} objects from immediately beneath the parent.
@@ -917,8 +918,8 @@
if lst == []:
lst = None
return lst
- _parseRepositories = staticmethod(_parseRepositories)
+ @staticmethod
def _addRepository(xmlDom, parentNode, repository):
"""
Adds a repository container as the next child of a parent.
@@ -946,8 +947,8 @@
addStringNode(xmlDom, sectionNode, "abs_path", repository.repositoryPath)
addStringNode(xmlDom, sectionNode, "collect_mode", repository.collectMode)
addStringNode(xmlDom, sectionNode, "compress_mode", repository.compressMode)
- _addRepository = staticmethod(_addRepository)
+ @staticmethod
def _parseRepositoryDirs(parent):
"""
Reads a list of C{RepositoryDir} objects from immediately beneath the parent.
@@ -988,8 +989,8 @@
if lst == []:
lst = None
return lst
- _parseRepositoryDirs = staticmethod(_parseRepositoryDirs)
+ @staticmethod
def _parseExclusions(parentNode):
"""
Reads exclusions data from immediately beneath the parent.
@@ -1013,8 +1014,8 @@
relative = readStringList(section, "rel_path")
patterns = readStringList(section, "pattern")
return (relative, patterns)
- _parseExclusions = staticmethod(_parseExclusions)
+ @staticmethod
def _addRepositoryDir(xmlDom, parentNode, repositoryDir):
"""
Adds a repository dir container as the next child of a parent.
@@ -1056,7 +1057,6 @@
if repositoryDir.excludePatterns is not None:
for pattern in repositoryDir.excludePatterns:
addStringNode(xmlDom, excludeNode, "pattern", pattern)
- _addRepositoryDir = staticmethod(_addRepositoryDir)
########################################################################
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -876,6 +876,7 @@
table[entry] = BackupFileList._generateDigest(entry)
return table
+ @staticmethod
def _generateDigest(path):
"""
Generates an SHA digest for a given file on disk.
@@ -927,7 +928,6 @@
digest = s.hexdigest()
logger.debug("Generated digest [%s] for file [%s]." % (digest, path))
return digest
- _generateDigest = staticmethod(_generateDigest)
def generateFitted(self, capacity, algorithm="worst_fit"):
"""
@@ -1016,6 +1016,7 @@
table[entry] = (entry, size)
return table
+ @staticmethod
def _getKnapsackFunction(algorithm):
"""
Returns a reference to the function associated with an algorithm name.
@@ -1034,7 +1035,6 @@
return alternateFit
else:
raise ValueError("Algorithm [%s] is invalid." % algorithm)
- _getKnapsackFunction = staticmethod(_getKnapsackFunction)
def generateTarfile(self, path, mode='tar', ignore=False, flat=False):
"""
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -316,6 +316,7 @@
# Private methods
##################
+ @staticmethod
def _copyLocalDir(sourceDir, targetDir, ownership=None, permissions=None):
"""
Copies files from the source directory to the target directory.
@@ -357,8 +358,8 @@
LocalPeer._copyLocalFile(sourceFile, targetFile, ownership, permissions)
filesCopied += 1
return filesCopied
- _copyLocalDir = staticmethod(_copyLocalDir)
+ @staticmethod
def _copyLocalFile(sourceFile=None, targetFile=None, ownership=None, permissions=None, overwrite=True):
"""
Copies a source file to a target file.
@@ -414,7 +415,6 @@
os.chown(targetFile, ownership[0], ownership[1])
if permissions is not None:
os.chmod(targetFile, permissions)
- _copyLocalFile = staticmethod(_copyLocalFile)
########################################################################
@@ -916,6 +916,7 @@
# Private methods
##################
+ @staticmethod
def _getDirContents(path):
"""
Returns the contents of a directory in terms of a Set.
@@ -938,8 +939,8 @@
except:
import sets
return sets.Set(contents)
- _getDirContents = staticmethod(_getDirContents)
+ @staticmethod
def _copyRemoteDir(remoteUser, localUser, remoteHost, rcpCommand, rcpCommandList,
sourceDir, targetDir, ownership=None, permissions=None):
"""
@@ -1036,8 +1037,8 @@
if permissions is not None:
os.chmod(targetFile, permissions)
return len(differenceSet)
- _copyRemoteDir = staticmethod(_copyRemoteDir)
+ @staticmethod
def _copyRemoteFile(remoteUser, localUser, remoteHost,
rcpCommand, rcpCommandList,
sourceFile, targetFile, ownership=None,
@@ -1123,8 +1124,8 @@
os.chown(targetFile, ownership[0], ownership[1])
if permissions is not None:
os.chmod(targetFile, permissions)
- _copyRemoteFile = staticmethod(_copyRemoteFile)
+ @staticmethod
def _pushLocalFile(remoteUser, localUser, remoteHost,
rcpCommand, rcpCommandList,
sourceFile, targetFile, overwrite=True):
@@ -1188,8 +1189,8 @@
result = executeCommand(command, [sourceFile.replace(" ", "\\ "), copyTarget])[0]
if result != 0:
raise IOError("Error (%d) copying [%s] to remote host." % (result, sourceFile))
- _pushLocalFile = staticmethod(_pushLocalFile)
+ @staticmethod
def _executeRemoteCommand(remoteUser, localUser, remoteHost, rshCommand, rshCommandList, remoteCommand):
"""
Executes a command on the peer via remote shell.
@@ -1229,8 +1230,8 @@
result = executeCommand(command, ["%s@%s" % (remoteUser, remoteHost), "%s" % remoteCommand])[0]
if result != 0:
raise IOError("Command failed [%s]" % (actualCommand))
- _executeRemoteCommand = staticmethod(_executeRemoteCommand)
+ @staticmethod
def _buildCbackCommand(cbackCommand, action, fullBackup):
"""
Builds a Cedar Backup command line for the named action.
@@ -1252,5 +1253,4 @@
return "%s --full %s" % (cbackCommand, action)
else:
return "%s %s" % (cbackCommand, action)
- _buildCbackCommand = staticmethod(_buildCbackCommand)
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -1037,6 +1037,7 @@
lines.append(line)
return lines
+ @staticmethod
def _getMaxLength(values):
"""
Get the maximum length from among a list of strings.
@@ -1046,7 +1047,6 @@
if len(value) > tmax:
tmax = len(value)
return tmax
- _getMaxLength = staticmethod(_getMaxLength)
def _getVersion(self):
"""
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -685,6 +685,7 @@
logger.debug("Returning disc boundaries: (%d, %d)" % (boundaries[0], boundaries[1]))
return boundaries
+ @staticmethod
def _calculateCapacity(media, boundaries):
"""
Calculates capacity for the media in terms of boundaries.
@@ -713,7 +714,6 @@
bytesAvailable = convertSize(sectorsAvailable, UNIT_SECTORS, UNIT_BYTES)
logger.debug("Used [%s], available [%s]." % (displayBytes(bytesUsed), displayBytes(bytesAvailable)))
return MediaCapacity(bytesUsed, bytesAvailable, boundaries)
- _calculateCapacity = staticmethod(_calculateCapacity)
#######################################################
@@ -986,6 +986,7 @@
# Methods used to parse command output
#######################################
+ @staticmethod
def _parsePropertiesOutput(output):
"""
Parses the output from a C{cdrecord} properties command.
@@ -1059,8 +1060,8 @@
deviceCanEject = True
logger.info("Device can eject its media.")
return (deviceType, deviceVendor, deviceId, deviceBufferSize, deviceSupportsMulti, deviceHasTray, deviceCanEject)
- _parsePropertiesOutput = staticmethod(_parsePropertiesOutput)
+ @staticmethod
def _parseBoundariesOutput(output):
"""
Parses the output from a C{cdrecord} capacity command.
@@ -1102,13 +1103,13 @@
except TypeError:
raise IOError("Unable to parse output of boundaries command.")
return boundaries
- _parseBoundariesOutput = staticmethod(_parseBoundariesOutput)
#################################
# Methods used to build commands
#################################
+ @staticmethod
def _buildOpenTrayArgs(device):
"""
Builds a list of arguments to be passed to a C{eject} command.
@@ -1124,8 +1125,8 @@
args = []
args.append(device)
return args
- _buildOpenTrayArgs = staticmethod(_buildOpenTrayArgs)
+ @staticmethod
def _buildCloseTrayArgs(device):
"""
Builds a list of arguments to be passed to a C{eject} command.
@@ -1142,8 +1143,8 @@
args.append("-t")
args.append(device)
return args
- _buildCloseTrayArgs = staticmethod(_buildCloseTrayArgs)
+ @staticmethod
def _buildPropertiesArgs(hardwareId):
"""
Builds a list of arguments to be passed to a C{cdrecord} command.
@@ -1159,8 +1160,8 @@
args.append("-prcap")
args.append("dev=%s" % hardwareId)
return args
- _buildPropertiesArgs = staticmethod(_buildPropertiesArgs)
+ @staticmethod
def _buildBoundariesArgs(hardwareId):
"""
Builds a list of arguments to be passed to a C{cdrecord} command.
@@ -1177,8 +1178,8 @@
args.append("-msinfo")
args.append("dev=%s" % hardwareId)
return args
- _buildBoundariesArgs = staticmethod(_buildBoundariesArgs)
+ @staticmethod
def _buildBlankArgs(hardwareId, driveSpeed=None):
"""
Builds a list of arguments to be passed to a C{cdrecord} command.
@@ -1200,8 +1201,8 @@
args.append("speed=%d" % driveSpeed)
args.append("dev=%s" % hardwareId)
return args
- _buildBlankArgs = staticmethod(_buildBlankArgs)
+ @staticmethod
def _buildWriteArgs(hardwareId, imagePath, driveSpeed=None, writeMulti=True):
"""
Builds a list of arguments to be passed to a C{cdrecord} command.
@@ -1230,5 +1231,4 @@
args.append("-data")
args.append(imagePath)
return args
- _buildWriteArgs = staticmethod(_buildWriteArgs)
Modified: cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -747,6 +747,7 @@
raise IOError("Error (%d) executing command to write disc." % result)
self.refreshMedia()
+ @staticmethod
def _getEstimatedImageSize(entries):
"""
Gets the estimated size of a set of image entries.
@@ -773,7 +774,6 @@
image.addEntry(path, entries[path], override=False, contentsOnly=True)
estimatedSize = image.getEstimatedSize() + fudgeFactor
return estimatedSize
- _getEstimatedImageSize = staticmethod(_getEstimatedImageSize)
def _retrieveSectorsUsed(self):
"""
@@ -808,6 +808,7 @@
os.rmdir(tempdir)
except: pass
+ @staticmethod
def _parseSectorsUsed(output):
"""
Parse sectors used information out of C{growisofs} output.
@@ -838,8 +839,8 @@
raise ValueError("Unable to parse sectors used out of growisofs output.")
logger.warn("Unable to read disc (might not be initialized); returning zero sectors used.")
return 0.0
- _parseSectorsUsed = staticmethod(_parseSectorsUsed)
+ @staticmethod
def _searchForOverburn(output):
"""
Search for an "overburn" error message in C{growisofs} output.
@@ -874,8 +875,8 @@
except ValueError:
logger.error("Image does not fit in available capacity (no useful capacity info available).")
raise IOError("Media does not contain enough capacity to store image.")
- _searchForOverburn = staticmethod(_searchForOverburn)
+ @staticmethod
def _buildWriteArgs(newDisc, hardwareId, driveSpeed, imagePath, entries, mediaLabel=None, dryRun=False):
"""
Builds a list of arguments to be passed to a C{growisofs} command.
@@ -941,5 +942,4 @@
else:
args.append("%s/=%s" % (entries[key].strip("/"), key))
return args
- _buildWriteArgs = staticmethod(_buildWriteArgs)
Modified: cedar-backup2/trunk/CedarBackup2/writers/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/CedarBackup2/writers/util.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -608,6 +608,7 @@
# Methods used to build mkisofs commands
#########################################
+ @staticmethod
def _buildDirEntries(entries):
"""
Uses an entries dictionary to build a list of directory locations for use
@@ -629,7 +630,6 @@
else:
dirEntries.append("%s/=%s" % (entries[key].strip("/"), key))
return dirEntries
- _buildDirEntries = staticmethod(_buildDirEntries)
def _buildGeneralArgs(self):
"""
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/Changelog 2010-07-07 19:34:11 UTC (rev 997)
@@ -1,8 +1,10 @@
-Version 2.19.7 01 Jul 2010
+Version 2.19.7 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 isRunningAsRoot() to replace scattered os.getuid() calls.
+ * Refactor out util.isRunningAsRoot() to replace scattered os.getuid() calls.
+ * Switch to minimum Python version of 2.5 (everyone should have it now).
+ - Convert to use @staticmethod rather than x = staticmethod(x)
* 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/doc/future/prune.py
===================================================================
--- cedar-backup2/trunk/doc/future/prune.py 2010-07-07 19:31:34 UTC (rev 996)
+++ cedar-backup2/trunk/doc/future/prune.py 2010-07-07 19:34:11 UTC (rev 997)
@@ -94,6 +94,7 @@
return prunedEntries
raise IOError("Unable to prune image to fit the capacity after four tries.")
+ @staticmethod
def _calculateSizes(entries):
"""
Calculates sizes for files in an entries dictionary.
@@ -121,8 +122,8 @@
else:
table[entry] = (entry, 0)
return (table, total)
- _calculateSizes = staticmethod(_calculateSizes)
+ @staticmethod
def _buildEntries(entries, items):
"""
Builds an entries dictionary.
@@ -143,8 +144,8 @@
for i in items:
newEntries[i] = entries[i]
return newEntries
- _buildEntries = staticmethod(_buildEntries)
+ @staticmethod
def _expandEntries(entries):
"""
Expands entries in an image to include only files.
@@ -209,5 +210,4 @@
graft = os.path.join(entries[entry].strip(os.sep), subdir.strip(os.sep), os.path.basename(item))
newEntries[item] = graft.strip(os.sep)
return newEntries
- _expandEntries = staticmethod(_expandEntries)
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:21
|
Revision: 996
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=996&view=rev
Author: pronovic
Date: 2010-07-07 19:31:34 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Roll back formal release
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 18:50:34 UTC (rev 995)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-07-07 19:31:34 UTC (rev 996)
@@ -35,6 +35,6 @@
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
VERSION = "2.19.7"
-DATE = "01 Jul 2010"
+DATE = "unreleased"
URL = "http://cedar-backup.sourceforge.net/"
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: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 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.isRunningAsRoot() to replace scattered os.getuid() calls.
* Switch to minimum Python version of 2.5 (everyone should have it now).
+ - Change file headers, comments, manual, etc. to reference Python 2.5
- Convert to use @staticmethod rather than x = staticmethod(x)
* Configure pylint and execute it against the entire codebase.
- Fix a variety of minor warnings and suggestions from pylint
Modified: cedar-backup2/trunk/INSTALL
===================================================================
--- cedar-backup2/trunk/INSTALL 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/INSTALL 2010-07-07 19:56:08 UTC (rev 998)
@@ -19,7 +19,7 @@
python setup.py --help
For more information on how to install it. You must have a Python
-interpreter version 2.3 or better to use these modules.
+interpreter version 2.5 or better to use these modules.
In the simplest case, you will probably just use:
Modified: cedar-backup2/trunk/cback
===================================================================
--- cedar-backup2/trunk/cback 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/cback 2010-07-07 19:56:08 UTC (rev 998)
@@ -10,7 +10,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Implements Cedar Backup cback script.
Modified: cedar-backup2/trunk/doc/cback-span.1
===================================================================
--- cedar-backup2/trunk/doc/cback-span.1 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/doc/cback-span.1 2010-07-07 19:56:08 UTC (rev 998)
@@ -93,7 +93,7 @@
codes related to particular errors.
.TP
\fB1\fR
-The Python interpreter version is < 2.3.
+The Python interpreter version is < 2.5.
.TP
\fB2\fR
Error processing command-line arguments.
Modified: cedar-backup2/trunk/doc/cback.1
===================================================================
--- cedar-backup2/trunk/doc/cback.1 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/doc/cback.1 2010-07-07 19:56:08 UTC (rev 998)
@@ -166,7 +166,7 @@
codes related to particular errors.
.TP
\fB1\fR
-The Python interpreter version is < 2.3.
+The Python interpreter version is < 2.5.
.TP
\fB2\fR
Error processing command-line arguments.
Modified: cedar-backup2/trunk/manual/src/depends.xml
===================================================================
--- cedar-backup2/trunk/manual/src/depends.xml 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/manual/src/depends.xml 2010-07-07 19:56:08 UTC (rev 998)
@@ -41,14 +41,13 @@
<variablelist>
<varlistentry>
- <term>Python 2.3</term>
+ <term>Python 2.5</term>
<listitem>
<para>
- Version 2.3 of the Python interpreter was released on 29 July
- 2003, so most <quote>current</quote> Linux and BSD distributions
- should include it (although Debian <quote>woody</quote> does
- not include it.)
+ Version 2.5 of the Python interpreter was released on 19 Sep
+ 2006, so most current Linux and BSD distributions should
+ include it.
</para>
<informaltable>
@@ -68,7 +67,7 @@
</row>
<row>
<entry>Debian</entry>
- <entry><ulink url="http://packages.debian.org/stable/python/python2.3"/></entry>
+ <entry><ulink url="http://packages.debian.org/stable/python/python2.5"/></entry>
</row>
<row>
<entry>Gentoo</entry>
@@ -80,7 +79,7 @@
</row>
<row>
<entry>Mac OS X (fink)</entry>
- <entry><ulink url="http://fink.sourceforge.net/pdb/package.php/python23"/></entry>
+ <entry><ulink url="http://fink.sourceforge.net/pdb/package.php/python25"/></entry>
</row>
</tbody>
</tgroup>
Modified: cedar-backup2/trunk/manual/src/install.xml
===================================================================
--- cedar-backup2/trunk/manual/src/install.xml 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/manual/src/install.xml 2010-07-07 19:56:08 UTC (rev 998)
@@ -200,8 +200,8 @@
</para>
<para>
- Cedar Backup is written in Python and requires version 2.3 or
- greater of the language. Version 2.3 was released on 29 July 2003,
+ Cedar Backup is written in Python and requires version 2.5 or
+ greater of the language. Python 2.5 was released on 19 Sep 2006,
so by now most current Linux and BSD distributions should include
it. You must install Python on every peer node in a pool (master or
client).
@@ -295,7 +295,7 @@
</screen>
<para>
- Make sure that you are using Python 2.3 or better to execute
+ Make sure that you are using Python 2.5 or better to execute
<filename>setup.py</filename>.
</para>
Modified: cedar-backup2/trunk/setup.py
===================================================================
--- cedar-backup2/trunk/setup.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/setup.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -10,7 +10,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Python distutils setup script
Modified: cedar-backup2/trunk/testcase/__init__.py
===================================================================
--- cedar-backup2/trunk/testcase/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/__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/testcase/actionsutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/actionsutiltests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/actionsutiltests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests action utility functionality.
Modified: cedar-backup2/trunk/testcase/capacitytests.py
===================================================================
--- cedar-backup2/trunk/testcase/capacitytests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/capacitytests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests capacity extension functionality.
Modified: cedar-backup2/trunk/testcase/cdwritertests.py
===================================================================
--- cedar-backup2/trunk/testcase/cdwritertests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/cdwritertests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests CD writer functionality.
Modified: cedar-backup2/trunk/testcase/clitests.py
===================================================================
--- cedar-backup2/trunk/testcase/clitests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/clitests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests command-line interface functionality.
Modified: cedar-backup2/trunk/testcase/configtests.py
===================================================================
--- cedar-backup2/trunk/testcase/configtests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/configtests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests configuration functionality.
Modified: cedar-backup2/trunk/testcase/customizetests.py
===================================================================
--- cedar-backup2/trunk/testcase/customizetests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/customizetests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests customization functionality.
Modified: cedar-backup2/trunk/testcase/dvdwritertests.py
===================================================================
--- cedar-backup2/trunk/testcase/dvdwritertests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/dvdwritertests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests DVD writer functionality.
Modified: cedar-backup2/trunk/testcase/encrypttests.py
===================================================================
--- cedar-backup2/trunk/testcase/encrypttests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/encrypttests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests encrypt extension functionality.
Modified: cedar-backup2/trunk/testcase/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/testcase/filesystemtests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/filesystemtests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests filesystem-related classes.
Modified: cedar-backup2/trunk/testcase/knapsacktests.py
===================================================================
--- cedar-backup2/trunk/testcase/knapsacktests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/knapsacktests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests knapsack functionality.
Modified: cedar-backup2/trunk/testcase/mboxtests.py
===================================================================
--- cedar-backup2/trunk/testcase/mboxtests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/mboxtests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests mbox extension functionality.
Modified: cedar-backup2/trunk/testcase/mysqltests.py
===================================================================
--- cedar-backup2/trunk/testcase/mysqltests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/mysqltests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests MySQL extension functionality.
Modified: cedar-backup2/trunk/testcase/peertests.py
===================================================================
--- cedar-backup2/trunk/testcase/peertests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/peertests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests peer functionality.
Modified: cedar-backup2/trunk/testcase/postgresqltests.py
===================================================================
--- cedar-backup2/trunk/testcase/postgresqltests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/postgresqltests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests PostgreSQL extension functionality.
Modified: cedar-backup2/trunk/testcase/spantests.py
===================================================================
--- cedar-backup2/trunk/testcase/spantests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/spantests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests span tool functionality.
Modified: cedar-backup2/trunk/testcase/splittests.py
===================================================================
--- cedar-backup2/trunk/testcase/splittests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/splittests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests split extension functionality.
Modified: cedar-backup2/trunk/testcase/subversiontests.py
===================================================================
--- cedar-backup2/trunk/testcase/subversiontests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/subversiontests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests Subversion extension functionality.
Modified: cedar-backup2/trunk/testcase/utiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/utiltests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/utiltests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests utility functionality.
Modified: cedar-backup2/trunk/testcase/writersutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/writersutiltests.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/testcase/writersutiltests.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Tests writer utility functionality.
Modified: cedar-backup2/trunk/util/__init__.py
===================================================================
--- cedar-backup2/trunk/util/__init__.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/util/__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/util/cback-span
===================================================================
--- cedar-backup2/trunk/util/cback-span 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/util/cback-span 2010-07-07 19:56:08 UTC (rev 998)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.3
+#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# vim: set ft=python ts=3 sw=3 expandtab:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -10,7 +10,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id: cback 605 2005-02-25 00:51:07Z pronovic $
# Purpose : Implements Cedar Backup cback-span script.
Modified: cedar-backup2/trunk/util/createtree.py
===================================================================
--- cedar-backup2/trunk/util/createtree.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/util/createtree.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Create a random directory structure for testing
Modified: cedar-backup2/trunk/util/knapsackdemo.py
===================================================================
--- cedar-backup2/trunk/util/knapsackdemo.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/util/knapsackdemo.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Demo the knapsack functionality in knapsack.py
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2010-07-07 19:34:11 UTC (rev 997)
+++ cedar-backup2/trunk/util/test.py 2010-07-07 19:56:08 UTC (rev 998)
@@ -26,7 +26,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Python (>= 2.3)
+# Language : Python (>= 2.5)
# Project : Cedar Backup, release 2
# Revision : $Id$
# Purpose : Run all of the unit tests for the project.
@@ -77,7 +77,7 @@
individual tests may be listed on the command line, and unknown values will
simply be ignored.
-@note: Even if you run this test with the C{python2.3} interpreter, some of the
+@note: Even if you run this test with the C{python2.5} interpreter, some of the
individual unit tests require the C{python} interpreter. In particular, the
utility tests (in test/utiltests.py) use brief Python script snippets with
known results to verify the behavior of C{executeCommand}.
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-01 18:10:33
|
Revision: 993
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=993&view=rev
Author: pronovic
Date: 2010-07-01 17:54:07 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tagging new version of 2.19.7 release of Cedar Backup.
Removed Paths:
-------------
cedar-backup2/tags/CEDAR_BACKUP2_V2.19.7/
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:54:22
|
Revision: 994
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=994&view=rev
Author: pronovic
Date: 2010-07-01 17:54:16 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tagging the 2.19.7 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.19.7/
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-01 16:27:12
|
Revision: 991
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=991&view=rev
Author: pronovic
Date: 2010-07-01 16:27:06 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tagging the 2.19.7 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.19.7/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 16:27:01
|
Revision: 990
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=990&view=rev
Author: pronovic
Date: 2010-07-01 16:26:55 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tagging new version of 2.19.7 release of Cedar Backup.
Removed Paths:
-------------
cedar-backup2/tags/CEDAR_BACKUP2_V2.19.7/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 16:26:50
|
Revision: 989
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=989&view=rev
Author: pronovic
Date: 2010-07-01 16:26:44 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Make sure manifest includes test cases
Modified Paths:
--------------
cedar-backup2/trunk/MANIFEST.in
Modified: cedar-backup2/trunk/MANIFEST.in
===================================================================
--- cedar-backup2/trunk/MANIFEST.in 2010-07-01 15:41:46 UTC (rev 988)
+++ cedar-backup2/trunk/MANIFEST.in 2010-07-01 16:26:44 UTC (rev 989)
@@ -14,8 +14,8 @@
include util/test.py
include util/knapsackdemo.py
include util/docbook/*
-include test/*.py
-include test/data/*
+include testcase/*.py
+include testcase/data/*
include manual/Makefile
include manual/src/*.xml
include manual/src/images/html/*.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 15:41:52
|
Revision: 988
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=988&view=rev
Author: pronovic
Date: 2010-07-01 15:41:46 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tweak test script
Modified Paths:
--------------
cedar-backup2/trunk/util/test.py
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2010-07-01 14:53:31 UTC (rev 987)
+++ cedar-backup2/trunk/util/test.py 2010-07-01 15:41:46 UTC (rev 988)
@@ -120,7 +120,7 @@
try:
if os.path.exists(os.path.join(".", "CedarBackup2", "filesystem.py")):
sys.path.insert(0, ".")
- elif os.path.basename(os.getcwd()) == "test" and os.path.exists(os.path.join("..", "CedarBackup2", "filesystem.py")):
+ elif os.path.basename(os.getcwd()) == "testcase" and os.path.exists(os.path.join("..", "CedarBackup2", "filesystem.py")):
sys.path.insert(0, "..")
else:
print "WARNING: CedarBackup2 modules were not found in the expected"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-07-01 14:53:38
|
Revision: 987
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=987&view=rev
Author: pronovic
Date: 2010-07-01 14:53:31 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Tagging the 2.19.7 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.19.7/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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 03:55:15
|
Revision: 985
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=985&view=rev
Author: pronovic
Date: 2010-07-01 03:55:08 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Add editor's note to TODO
Modified Paths:
--------------
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-01 03:34:55 UTC (rev 984)
+++ cedar-backup2/trunk/TODO 2010-07-01 03:55:08 UTC (rev 985)
@@ -14,6 +14,15 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+Editor's note: these are musings on changes that would be worth making
+in Cedar Backup 3. However, unless I find myself unemployed for a long
+period of time, they're unlikely to happen. Cedar Backup 2 is stable
+and is reasonably easy to maintain given the number of changes that
+are needed in any given year. As a result, a major rewrite isn't really
+worthwhile.
+
+============================
+
Would be nice if substitute/replace worked in configuration
files (i.e. set up a $VARIABLE and substitute elsewhere).
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
-
-# 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-07-01 03:34:37
|
Revision: 983
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=983&view=rev
Author: pronovic
Date: 2010-07-01 03:34:29 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Fix pylint warnings
Modified Paths:
--------------
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/splittests.py
cedar-backup2/trunk/testcase/subversiontests.py
cedar-backup2/trunk/testcase/utiltests.py
cedar-backup2/trunk/testcase/writersutiltests.py
Modified: cedar-backup2/trunk/testcase/__init__.py
===================================================================
--- cedar-backup2/trunk/testcase/__init__.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/__init__.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -20,7 +20,9 @@
# Package initialization
########################################################################
-# This causes the test directory to be a package.
+"""
+This causes the test directory to be a package.
+"""
__all__ = [ ]
Modified: cedar-backup2/trunk/testcase/actionsutiltests.py
===================================================================
--- cedar-backup2/trunk/testcase/actionsutiltests.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/actionsutiltests.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -74,11 +74,9 @@
# Import modules and do runtime validations
########################################################################
-import sys
import os
import unittest
import tempfile
-import tarfile
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
from CedarBackup2.actions.util import findDailyDirs, writeIndicatorFile
from CedarBackup2.extend.encrypt import ENCRYPT_INDICATOR
@@ -154,7 +152,7 @@
Test with an empty staging directory.
"""
self.extractTar("tree8")
- stagingDir = self.buildPath(["tree8", "dir001",])
+ stagingDir = self.buildPath(["tree8", "dir001", ])
dailyDirs = findDailyDirs(stagingDir, ENCRYPT_INDICATOR)
self.failUnlessEqual([], dailyDirs)
@@ -163,7 +161,7 @@
Test with a staging directory containing only files.
"""
self.extractTar("tree1")
- stagingDir = self.buildPath(["tree1",])
+ stagingDir = self.buildPath(["tree1", ])
dailyDirs = findDailyDirs(stagingDir, ENCRYPT_INDICATOR)
self.failUnlessEqual([], dailyDirs)
@@ -248,9 +246,9 @@
Test with a valid staging directory.
"""
self.extractTar("tree8")
- stagingDir = self.buildPath(["tree8", "dir001",])
+ stagingDir = self.buildPath(["tree8", "dir001", ])
writeIndicatorFile(stagingDir, ENCRYPT_INDICATOR, None, None)
- self.failUnless(os.path.exists(self.buildPath(["tree8", "dir001", ENCRYPT_INDICATOR,])))
+ self.failUnless(os.path.exists(self.buildPath(["tree8", "dir001", ENCRYPT_INDICATOR, ])))
#######################################################################
Modified: cedar-backup2/trunk/testcase/capacitytests.py
===================================================================
--- cedar-backup2/trunk/testcase/capacitytests.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/capacitytests.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -93,7 +93,6 @@
# System modules
import unittest
-import os
# Cedar Backup modules
from CedarBackup2.util import UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES
@@ -126,9 +125,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -323,9 +322,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -549,9 +548,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
def validateAddConfig(self, origConfig):
"""
Modified: cedar-backup2/trunk/testcase/cdwritertests.py
===================================================================
--- cedar-backup2/trunk/testcase/cdwritertests.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/cdwritertests.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -100,22 +100,12 @@
# Import modules and do runtime validations
########################################################################
-import sys
-import os
-import re
import unittest
-import tempfile
-import tarfile
from CedarBackup2.writers.cdwriter import MediaDefinition, MediaCapacity, CdWriter
from CedarBackup2.writers.cdwriter import MEDIA_CDR_74, MEDIA_CDRW_74, MEDIA_CDR_80, MEDIA_CDRW_80
-from CedarBackup2.filesystem import FilesystemList
-from CedarBackup2.util import executeCommand, convertSize, UNIT_BYTES, UNIT_MBYTES
-from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
-from CedarBackup2.testutil import platformMacOsX, platformSupportsLinks
-
#######################################################################
# Module-wide configuration and constants
#######################################################################
@@ -604,7 +594,7 @@
capacity = CdWriter._calculateCapacity(media, boundaries)
self.failUnlessEqual(expectedUsed, capacity.bytesUsed)
self.failUnlessEqual(expectedAvailable, capacity.bytesAvailable)
- self.failUnlessEqual((0,999), capacity.boundaries)
+ self.failUnlessEqual((0, 999), capacity.boundaries)
def testCapacity_010(self):
"""
@@ -702,7 +692,7 @@
Test _getBoundaries when self.deviceSupportsMulti is False; entireDisc=False, useMulti=True.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = False;
+ writer._deviceSupportsMulti = False
boundaries = writer._getBoundaries(entireDisc=False, useMulti=True)
self.failUnlessEqual(None, boundaries)
@@ -711,7 +701,7 @@
Test _getBoundaries when self.deviceSupportsMulti is False; entireDisc=True, useMulti=True.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = False;
+ writer._deviceSupportsMulti = False
boundaries = writer._getBoundaries(entireDisc=True, useMulti=True)
self.failUnlessEqual(None, boundaries)
@@ -720,7 +710,7 @@
Test _getBoundaries when self.deviceSupportsMulti is False; entireDisc=True, useMulti=False.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = False;
+ writer._deviceSupportsMulti = False
boundaries = writer._getBoundaries(entireDisc=False, useMulti=False)
self.failUnlessEqual(None, boundaries)
@@ -729,7 +719,7 @@
Test _getBoundaries when self.deviceSupportsMulti is False; entireDisc=False, useMulti=False.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = False;
+ writer._deviceSupportsMulti = False
boundaries = writer._getBoundaries(entireDisc=False, useMulti=False)
self.failUnlessEqual(None, boundaries)
@@ -738,7 +728,7 @@
Test _getBoundaries when self.deviceSupportsMulti is True; entireDisc=True, useMulti=True.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = True;
+ writer._deviceSupportsMulti = True
boundaries = writer._getBoundaries(entireDisc=True, useMulti=True)
self.failUnlessEqual(None, boundaries)
@@ -747,7 +737,7 @@
Test _getBoundaries when self.deviceSupportsMulti is True; entireDisc=True, useMulti=False.
"""
writer = CdWriter(device="/dev/cdrw", scsiId="0,0,0", unittest=True)
- writer._deviceSupportsMulti = True;
+ writer._deviceSupportsMulti = True
boundaries = writer._getBoundaries(entireDisc=True, useMulti=False)
self.failUnlessEqual(None, boundaries)
@@ -767,7 +757,7 @@
def testCapacity_024(self):
"""
- Test _calculateCapacity for boundaries of (0,330042) and MEDIA_CDRW_74.
+ Test _calculateCapacity for boundaries of (0, 330042) and MEDIA_CDRW_74.
This was a bug fixed for v2.1.3.
"""
expectedUsed = (330042*2048.0) # 330042 sectors
Modified: cedar-backup2/trunk/testcase/clitests.py
===================================================================
--- cedar-backup2/trunk/testcase/clitests.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/clitests.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -162,9 +162,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -7652,7 +7652,7 @@
Test with actions=[ collect, one ], extensions=[ (one, before collect) ].
"""
actions = [ "collect", "one", ]
- dependencies = ActionDependencies(["collect",], [])
+ dependencies = ActionDependencies(["collect", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -7671,7 +7671,7 @@
Test with actions=[ stage, one ], extensions=[ (one, before stage) ].
"""
actions = [ "stage", "one", ]
- dependencies = ActionDependencies(["stage",], None)
+ dependencies = ActionDependencies(["stage", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -7690,7 +7690,7 @@
Test with actions=[ store, one ], extensions=[ (one, before store) ].
"""
actions = [ "store", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -7709,7 +7709,7 @@
Test with actions=[ purge, one ], extensions=[ (one, before purge) ].
"""
actions = [ "purge", "one", ]
- dependencies = ActionDependencies(["purge",], None)
+ dependencies = ActionDependencies(["purge", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -7728,7 +7728,7 @@
Test with actions=[ all, one ], extensions=[ (one, before collect) ].
"""
actions = [ "all", "one", ]
- dependencies = ActionDependencies(["collect",], [])
+ dependencies = ActionDependencies(["collect", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
@@ -7738,7 +7738,7 @@
Test with actions=[ rebuild, one ], extensions=[ (one, before collect) ].
"""
actions = [ "rebuild", "one", ]
- dependencies = ActionDependencies(["collect",], None)
+ dependencies = ActionDependencies(["collect", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
@@ -7748,7 +7748,7 @@
Test with actions=[ validate, one ], extensions=[ (one, before collect) ].
"""
actions = [ "validate", "one", ]
- dependencies = ActionDependencies(["stage",], [])
+ dependencies = ActionDependencies(["stage", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
@@ -7997,7 +7997,7 @@
Test with actions=[ collect, one ], extensions=[ (one, before store) ].
"""
actions = [ "collect", "one", ]
- dependencies = ActionDependencies(["store",], None)
+ dependencies = ActionDependencies(["store", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8016,7 +8016,7 @@
Test with actions=[ stage, one ], extensions=[ (one, before store) ].
"""
actions = [ "stage", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8035,7 +8035,7 @@
Test with actions=[ store, one ], extensions=[ (one, before store) ].
"""
actions = [ "store", "one", ]
- dependencies = ActionDependencies(["store",], None)
+ dependencies = ActionDependencies(["store", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8054,7 +8054,7 @@
Test with actions=[ purge, one ], extensions=[ (one, before store) ].
"""
actions = [ "purge", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8103,7 +8103,7 @@
Test with actions=[ collect, one ], extensions=[ (one, after store) ].
"""
actions = [ "collect", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8122,7 +8122,7 @@
Test with actions=[ stage, one ], extensions=[ (one, after store) ].
"""
actions = [ "stage", "one", ]
- dependencies = ActionDependencies(["store",], None)
+ dependencies = ActionDependencies(["store", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8141,7 +8141,7 @@
Test with actions=[ store, one ], extensions=[ (one, after store) ].
"""
actions = [ "store", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8160,7 +8160,7 @@
Test with actions=[ purge, one ], extensions=[ (one, after store) ].
"""
actions = [ "purge", "one", ]
- dependencies = ActionDependencies(["store",], None)
+ dependencies = ActionDependencies(["store", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
actionSet = _ActionSet(actions, extensions, options, None, False, True)
@@ -8255,7 +8255,7 @@
Test with actions=[ all, one ], extensions=[ (one, after store) ].
"""
actions = [ "all", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
@@ -8265,7 +8265,7 @@
Test with actions=[ rebuild, one ], extensions=[ (one, after store) ].
"""
actions = [ "rebuild", "one", ]
- dependencies = ActionDependencies(["store",], None)
+ dependencies = ActionDependencies(["store", ], None)
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
@@ -8275,7 +8275,7 @@
Test with actions=[ validate, one ], extensions=[ (one, after store) ].
"""
actions = [ "validate", "one", ]
- dependencies = ActionDependencies(["store",], [])
+ dependencies = ActionDependencies(["store", ], [])
extensions = ExtensionsConfig([ ExtendedAction("one", "os.path", "isdir", dependencies=dependencies), ], "dependency")
options = OptionsConfig()
self.failUnlessRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
Modified: cedar-backup2/trunk/testcase/configtests.py
===================================================================
--- cedar-backup2/trunk/testcase/configtests.py 2010-06-30 23:03:17 UTC (rev 982)
+++ cedar-backup2/trunk/testcase/configtests.py 2010-07-01 03:34:29 UTC (rev 983)
@@ -99,10 +99,9 @@
# Import modules and do runtime validations
########################################################################
-import os
import unittest
from CedarBackup2.util import UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES
-from CedarBackup2.testutil import findResources, removedir, failUnlessAssignRaises
+from CedarBackup2.testutil import findResources, failUnlessAssignRaises
from CedarBackup2.testutil import hexFloatLiteralAllowed
from CedarBackup2.config import ActionHook, PreActionHook, PostActionHook, CommandOverride
from CedarBackup2.config import ExtendedAction, ActionDependencies, BlankBehavior
@@ -141,9 +140,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -415,9 +414,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -674,9 +673,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -874,9 +873,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -1074,9 +1073,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -1274,9 +1273,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -1497,9 +1496,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -1930,9 +1929,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -2122,9 +2121,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -2407,9 +2406,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -2884,8 +2883,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)
+ collectDir2 = CollectDir("/etc/whatever", "incr", "tar", ".ignore", ["/one", ], ["two", ], ["three", ], 1, True)
self.failUnless(collectDir1 == collectDir2)
self.failUnless(not collectDir1 < collectDir2)
self.failUnless(collectDir1 <= collectDir2)
@@ -3026,7 +3025,7 @@
(one None, one not empty).
"""
collectDir1 = CollectDir()
- collectDir2 = CollectDir(absoluteExcludePaths=["/whatever",])
+ collectDir2 = CollectDir(absoluteExcludePaths=["/whatever", ])
self.failIfEqual(collectDir1, collectDir2)
self.failUnless(not collectDir1 == collectDir2)
self.failUnless(collectDir1 < collectDir2)
@@ -3254,9 +3253,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -3483,9 +3482,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -3615,7 +3614,7 @@
"""
localPeer = LocalPeer()
self.failUnlessEqual(None, localPeer.ignoreFailureMode)
- localPeer.ignoreFailureMode = None;
+ localPeer.ignoreFailureMode = None
self.failUnlessEqual(None, localPeer.ignoreFailureMode)
@@ -3747,9 +3746,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -4070,7 +4069,7 @@
"""
remotePeer = RemotePeer()
self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
- remotePeer.ignoreFailureMode = None;
+ remotePeer.ignoreFailureMode = None
self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
@@ -4403,9 +4402,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -4767,9 +4766,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -5071,9 +5070,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -6039,53 +6038,53 @@
"""
Test addOverride() with no existing overrides.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.addOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides)
def testOverrides_002(self):
"""
Test addOverride() with no existing override that matches.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.overrides = [ CommandOverride("one", "/one"), ]
options.addOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides)
def testOverrides_003(self):
"""
Test addOverride(), with existing override that matches.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.overrides = [ CommandOverride("cdrecord", "/one"), ]
options.addOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("cdrecord", "/one"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/one"), ], options.overrides)
def testOverrides_004(self):
"""
Test replaceOverride() with no existing overrides.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.replaceOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides)
def testOverrides_005(self):
"""
Test replaceOverride() with no existing override that matches.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.overrides = [ CommandOverride("one", "/one"), ]
options.replaceOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides)
def testOverrides_006(self):
"""
Test replaceOverride(), with existing override that matches.
"""
- options = OptionsConfig();
+ options = OptionsConfig()
options.overrides = [ CommandOverride("cdrecord", "/one"), ]
options.replaceOverride("cdrecord", "/usr/bin/wodim")
- self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides)
@@ -6101,9 +6100,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -6461,9 +6460,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -6513,15 +6512,15 @@
"""
Test constructor with all values filled in, with valid values (lists not empty).
"""
- collect = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failUnlessEqual("/target", collect.targetDir)
self.failUnlessEqual("incr", collect.collectMode)
self.failUnlessEqual("tar", collect.archiveMode)
self.failUnlessEqual("ignore", collect.ignoreFile)
- self.failUnlessEqual(["/path",], collect.absoluteExcludePaths)
- self.failUnlessEqual(["pattern",], collect.excludePatterns)
- self.failUnlessEqual([CollectFile(),], collect.collectFiles)
- self.failUnlessEqual([CollectDir(),], collect.collectDirs)
+ self.failUnlessEqual(["/path", ], collect.absoluteExcludePaths)
+ self.failUnlessEqual(["pattern", ], collect.excludePatterns)
+ self.failUnlessEqual([CollectFile(), ], collect.collectFiles)
+ self.failUnlessEqual([CollectDir(), ], collect.collectDirs)
def testConstructor_004(self):
"""
@@ -6690,7 +6689,7 @@
"""
collect = CollectConfig()
self.failUnlessEqual(None, collect.absoluteExcludePaths)
- collect.absoluteExcludePaths = ["/whatever",]
+ collect.absoluteExcludePaths = ["/whatever", ]
self.failUnlessEqual(["/whatever", ], collect.absoluteExcludePaths)
def testConstructor_022(self):
@@ -6954,8 +6953,8 @@
"""
Test comparison of two identical objects, all attributes non-None.
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failUnlessEqual(collect1, collect2)
self.failUnless(collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -6968,8 +6967,8 @@
"""
Test comparison of two differing objects, targetDir differs (one None).
"""
- collect1 = CollectConfig(None, "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target2", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig(None, "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target2", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -6982,8 +6981,8 @@
"""
Test comparison of two differing objects, targetDir differs.
"""
- collect1 = CollectConfig("/target1", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target2", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target1", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target2", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -6996,8 +6995,8 @@
"""
Test comparison of two differing objects, collectMode differs (one None).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", None, "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", None, "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7010,8 +7009,8 @@
"""
Test comparison of two differing objects, collectMode differs.
"""
- collect1 = CollectConfig("/target", "daily", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "daily", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7024,8 +7023,8 @@
"""
Test comparison of two differing objects, archiveMode differs (one None).
"""
- collect1 = CollectConfig("/target", "incr", None, "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", None, "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7038,8 +7037,8 @@
"""
Test comparison of two differing objects, archiveMode differs.
"""
- collect1 = CollectConfig("/target", "incr", "targz", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tarbz2", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "targz", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tarbz2", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7052,8 +7051,8 @@
"""
Test comparison of two differing objects, ignoreFile differs (one None).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", None, ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", None, ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7066,8 +7065,8 @@
"""
Test comparison of two differing objects, ignoreFile differs.
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore1", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore2", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore1", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore2", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7081,8 +7080,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(one None, one empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", None, ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", [], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", None, ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", [], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7096,8 +7095,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(one None, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", None, ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", None, ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7111,8 +7110,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(one empty, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", [], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", [], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7126,8 +7125,8 @@
Test comparison of two differing objects, absoluteExcludePaths differs
(both not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", "/path2", ], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", "/path2", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7141,8 +7140,8 @@
Test comparison of two differing objects, excludePatterns differs (one
None, one empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], None, [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], [], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], None, [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], [], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7156,8 +7155,8 @@
Test comparison of two differing objects, excludePatterns differs (one
None, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], None, [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], None, [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7171,8 +7170,8 @@
Test comparison of two differing objects, excludePatterns differs (one
empty, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], [], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], [], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7186,8 +7185,8 @@
Test comparison of two differing objects, excludePatterns differs (both
not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern", "bogus", ], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", "bogus", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7201,8 +7200,8 @@
Test comparison of two differing objects, collectDirs differs (one
None, one empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], None)
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], None)
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7216,8 +7215,8 @@
Test comparison of two differing objects, collectDirs differs (one
None, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], None)
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], None)
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7231,8 +7230,8 @@
Test comparison of two differing objects, collectDirs differs (one
empty, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7246,8 +7245,8 @@
Test comparison of two differing objects, collectDirs differs (both
not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(), CollectDir(), ])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7261,8 +7260,8 @@
Test comparison of two differing objects, collectFiles differs (one
None, one empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], None, [CollectDir(), ])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [], [CollectDir(), ])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], None, [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7276,8 +7275,8 @@
Test comparison of two differing objects, collectFiles differs (one
None, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], None, [CollectDir(), ])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(), ])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], None, [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(collect1 < collect2)
@@ -7291,8 +7290,8 @@
Test comparison of two differing objects, collectFiles differs (one
empty, one not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(), ])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [], [CollectDir(), ])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7306,8 +7305,8 @@
Test comparison of two differing objects, collectFiles differs (both
not empty).
"""
- collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), CollectFile(), ], [CollectDir() ])
- collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path",], ["pattern",], [CollectFile(), ], [CollectDir(),])
+ collect1 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), CollectFile(), ], [CollectDir() ])
+ collect2 = CollectConfig("/target", "incr", "tar", "ignore", ["/path", ], ["pattern", ], [CollectFile(), ], [CollectDir(), ])
self.failIfEqual(collect1, collect2)
self.failUnless(not collect1 == collect2)
self.failUnless(not collect1 < collect2)
@@ -7329,9 +7328,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -7756,9 +7755,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -8589,9 +8588,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -8823,9 +8822,9 @@
# Utility methods
##################
- def failUnlessAssignRaises(self, exception, object, property, value):
+ def failUnlessAssignRaises(self, exception, obj, prop, value):
"""Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
- failUnlessAssignRaises(self, exception, object, property, value)
+ failUnlessAssignRaises(self, exception, obj, prop, value)
############################
@@ -9561,7 +9560,7 @@
config2.reference = ReferenceConfig()
config2.extensions = ExtensionsConfig()
config2.options = OptionsConfig()
- config2.peers = PeersConfig(localPeers=[LocalPeer(),])
+ config2.peers = PeersConfig(localPeers=[LocalPeer(), ])
config2.collect = CollectConfig()
config2.stage = StageConfig()
config2.store = StoreConfig()
@@ -9965,7 +9964,7 @@
config._validateCollect()
config.collect.collectDirs.append(CollectDir(absolutePath="/stuff2"))
self.failUnlessRaises(ValueError, config._validateCollect)
- config.collect.collectDirs[-1].collectMode="daily"
+ config.collect.collectDirs[-1].collectMode = "daily"
config._validateCollect()
def testValidate_022a(self):
@@ -9981,7 +9980,7 @@
config._validateCollect()
config.collect.collectFiles.append(CollectFile(absolutePath="/stuff2"))
self.failUnlessRaises(ValueError, config._validateCollect)
- config.collect.collectFiles[-1].collectMode="daily"
+ config.collect.collectFiles[-1].collectMode = "daily"
config._validateCollect()
def testValidate_023(self):
@@ -11186,19 +11185,19 @@
dependencies=ActionDependencies()))
expected.extensions.actions.append(ExtendedAction("postgresql", "CedarBackup2.extend.postgresql", "executeAction",
index=None,
- dependencies=ActionDependencies(beforeList=["one",])))
+ dependencies=ActionDependencies(beforeList=["one", ])))
expected.extensions.actions.append(ExtendedAction("subversion", "CedarBackup2.extend.subversion", "executeAction",
index=None,
- dependencies=ActionDependencies(afterList=["one",])))
+ dependencies=ActionDependencies(afterList=["one", ])))
expected.extensions.actions.append(ExtendedAction("mbox", "CedarBackup2.extend.mbox", "executeAction",
index=None,
- dependencies=ActionDependencies(beforeList=["one",], afterList=["one",])))
+ dependencies=ActionDependencies(beforeList=["one", ], afterList=["one", ])))
expected.extensions.actions.append(ExtendedAction("encrypt", "CedarBackup2.extend.encrypt", "executeAction",
index=None,
- dependencies=ActionDependencies(beforeList=["a", "b", "c", "d",],
+ dependencies=ActionDependencies(beforeList=["a", "b", "c", "d", ],
afterList=["one", "two", "three",
"four", "five", "six",
- "seven", "eight",])))
+ "se...
[truncated message content] |
|
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-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 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:54:26
|
Revision: 979
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=979&view=rev
Author: pronovic
Date: 2010-06-30 22:54:17 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Fix minor warnings exposed by pylint
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/action.py
cedar-backup2/trunk/CedarBackup2/actions/store.py
cedar-backup2/trunk/CedarBackup2/actions/util.py
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/image.py
cedar-backup2/trunk/CedarBackup2/knapsack.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/testutil.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/cdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/util.py
cedar-backup2/trunk/CedarBackup2/xmlutil.py
Modified: cedar-backup2/trunk/CedarBackup2/action.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/action.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/action.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -35,6 +35,7 @@
# Imported modules
########################################################################
+# pylint: disable-msg=W0611
from CedarBackup2.actions.collect import executeCollect
from CedarBackup2.actions.stage import executeStage
from CedarBackup2.actions.store import executeStore
Modified: cedar-backup2/trunk/CedarBackup2/actions/store.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/actions/store.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -57,7 +57,7 @@
# Cedar Backup modules
from CedarBackup2.filesystem import compareContents
-from CedarBackup2.util import isStartOfWeek, getUidGid, changeOwnership
+from CedarBackup2.util import isStartOfWeek
from CedarBackup2.util import mount, unmount, displayBytes
from CedarBackup2.actions.util import createWriter, checkMediaState, buildMediaLabel, writeIndicatorFile
from CedarBackup2.actions.constants import DIR_TIME_FORMAT, STAGE_INDICATOR, STORE_INDICATOR
@@ -362,11 +362,11 @@
"""
oneDay = datetime.timedelta(days=1)
today = datetime.date.today()
- yesterday = today - oneDay;
- tomorrow = today + oneDay;
- todayDate = today.strftime(DIR_TIME_FORMAT);
- yesterdayDate = yesterday.strftime(DIR_TIME_FORMAT);
- tomorrowDate = tomorrow.strftime(DIR_TIME_FORMAT);
+ yesterday = today - oneDay
+ tomorrow = today + oneDay
+ todayDate = today.strftime(DIR_TIME_FORMAT)
+ yesterdayDate = yesterday.strftime(DIR_TIME_FORMAT)
+ tomorrowDate = tomorrow.strftime(DIR_TIME_FORMAT)
todayPath = os.path.join(config.stage.targetDir, todayDate)
yesterdayPath = os.path.join(config.stage.targetDir, yesterdayDate)
tomorrowPath = os.path.join(config.stage.targetDir, tomorrowDate)
Modified: cedar-backup2/trunk/CedarBackup2/actions/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -368,7 +368,7 @@
return MEDIA_DVDPLUSR
elif mediaType == "dvd+rw":
logger.debug("Media type is MEDIA_DVDPLUSRW.")
- return MEDIA_DVDPLUSR
+ return MEDIA_DVDPLUSRW
else:
raise ValueError("Media type [%s] is not valid." % mediaType)
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -88,7 +88,7 @@
# Cedar Backup modules
from CedarBackup2.release import AUTHOR, EMAIL, VERSION, DATE, COPYRIGHT
from CedarBackup2.customize import customizeOverrides
-from CedarBackup2.util import RestrictedContentList, DirectedGraph, PathResolverSingleton
+from CedarBackup2.util import DirectedGraph, PathResolverSingleton
from CedarBackup2.util import sortDict, splitCommandLine, executeCommand, getFunctionReference
from CedarBackup2.util import getUidGid, encodePath, Diagnostics
from CedarBackup2.config import Config
@@ -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):
+ def _executeHook(self, type, hook): # pylint: disable-msg=W0622,R0201
"""
Executes a hook command via L{util.executeCommand()}.
@param type: String describing the type of hook, for logging.
@@ -615,25 +615,25 @@
indexMap = {}
if extensions is None or extensions.actions is None or extensions.actions == []:
logger.info("Action ordering will use 'index' order mode.")
- indexMap['rebuild'] = REBUILD_INDEX;
- indexMap['validate'] = VALIDATE_INDEX;
- indexMap['initialize'] = INITIALIZE_INDEX;
- indexMap['collect'] = COLLECT_INDEX;
- indexMap['stage'] = STAGE_INDEX;
- indexMap['store'] = STORE_INDEX;
- indexMap['purge'] = PURGE_INDEX;
+ indexMap['rebuild'] = REBUILD_INDEX
+ indexMap['validate'] = VALIDATE_INDEX
+ indexMap['initialize'] = INITIALIZE_INDEX
+ indexMap['collect'] = COLLECT_INDEX
+ indexMap['stage'] = STAGE_INDEX
+ indexMap['store'] = STORE_INDEX
+ indexMap['purge'] = PURGE_INDEX
logger.debug("Completed filling in action indices for built-in actions.")
logger.info("Action order will be: %s" % sortDict(indexMap))
else:
if extensions.orderMode is None or extensions.orderMode == "index":
logger.info("Action ordering will use 'index' order mode.")
- indexMap['rebuild'] = REBUILD_INDEX;
- indexMap['validate'] = VALIDATE_INDEX;
- indexMap['initialize'] = INITIALIZE_INDEX;
- indexMap['collect'] = COLLECT_INDEX;
- indexMap['stage'] = STAGE_INDEX;
- indexMap['store'] = STORE_INDEX;
- indexMap['purge'] = PURGE_INDEX;
+ indexMap['rebuild'] = REBUILD_INDEX
+ indexMap['validate'] = VALIDATE_INDEX
+ indexMap['initialize'] = INITIALIZE_INDEX
+ indexMap['collect'] = COLLECT_INDEX
+ indexMap['stage'] = STAGE_INDEX
+ indexMap['store'] = STORE_INDEX
+ indexMap['purge'] = PURGE_INDEX
logger.debug("Completed filling in action indices for built-in actions.")
for action in extensions.actions:
indexMap[action.name] = action.index
@@ -1328,83 +1328,83 @@
"""
if other is None:
return 1
- if self._help != other._help:
- if self._help < other._help:
+ if self.help != other.help:
+ if self.help < other.help:
return -1
else:
return 1
- if self._version != other._version:
- if self._version < other._version:
+ if self.version != other.version:
+ if self.version < other.version:
return -1
else:
return 1
- if self._verbose != other._verbose:
- if self._verbose < other._verbose:
+ if self.verbose != other.verbose:
+ if self.verbose < other.verbose:
return -1
else:
return 1
- if self._quiet != other._quiet:
- if self._quiet < other._quiet:
+ if self.quiet != other.quiet:
+ if self.quiet < other.quiet:
return -1
else:
return 1
- if self._config != other._config:
- if self._config < other._config:
+ if self.config != other.config:
+ if self.config < other.config:
return -1
else:
return 1
- if self._full != other._full:
- if self._full < other._full:
+ if self.full != other.full:
+ if self.full < other.full:
return -1
else:
return 1
- if self._managed != other._managed:
- if self._managed < other._managed:
+ if self.managed != other.managed:
+ if self.managed < other.managed:
return -1
else:
return 1
- if self._managedOnly != other._managedOnly:
- if self._managedOnly < other._managedOnly:
+ if self.managedOnly != other.managedOnly:
+ if self.managedOnly < other.managedOnly:
return -1
else:
return 1
- if self._logfile != other._logfile:
- if self._logfile < other._logfile:
+ if self.logfile != other.logfile:
+ if self.logfile < other.logfile:
return -1
else:
return 1
- if self._owner != other._owner:
- if self._owner < other._owner:
+ if self.owner != other.owner:
+ if self.owner < other.owner:
return -1
else:
return 1
- if self._mode != other._mode:
- if self._mode < other._mode:
+ if self.mode != other.mode:
+ if self.mode < other.mode:
return -1
else:
return 1
- if self._output != other._output:
- if self._output < other._output:
+ if self.output != other.output:
+ if self.output < other.output:
return -1
else:
return 1
- if self._debug != other._debug:
- if self._debug < other._debug:
+ if self.debug != other.debug:
+ if self.debug < other.debug:
return -1
else:
return 1
- if self._stacktrace != other._stacktrace:
- if self._stacktrace < other._stacktrace:
+ if self.stacktrace != other.stacktrace:
+ if self.stacktrace < other.stacktrace:
return -1
else:
return 1
- if self._diagnostics != other._diagnostics:
- if self._diagnostics < other._diagnostics:
+ if self.diagnostics != other.diagnostics:
+ if self.diagnostics < other.diagnostics:
return -1
else:
return 1
- if self._actions != other._actions:
- if self._actions < other._actions:
+ if self.actions != other.actions:
+ if self.actions < other.actions:
return -1
else:
return 1
@@ -1894,7 +1894,7 @@
"""
switches = { }
opts, self.actions = getopt.getopt(argumentList, SHORT_SWITCHES, LONG_SWITCHES)
- for o,a in opts: # push the switches into a hash
+ for o, a in opts: # push the switches into a hash
switches[o] = a
if switches.has_key("-h") or switches.has_key("--help"):
self.help = True
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -341,13 +341,13 @@
"""
if other is None:
return 1
- if self._quantity != other._quantity:
- if self._quantity < other._quantity:
+ if self.quantity != other.quantity:
+ if self.quantity < other.quantity:
return -1
else:
return 1
- if self._units != other._units:
- if self._units < other._units:
+ if self.units != other.units:
+ if self.units < other.units:
return -1
else:
return 1
@@ -467,13 +467,13 @@
"""
if other is None:
return 1
- if self._beforeList != other._beforeList:
- if self._beforeList < other._beforeList:
+ if self.beforeList != other.beforeList:
+ if self.beforeList < other.beforeList:
return -1
else:
return 1
- if self._afterList != other._afterList:
- if self._afterList < other._afterList:
+ if self.afterList != other.afterList:
+ if self.afterList < other.afterList:
return -1
else:
return 1
@@ -594,23 +594,23 @@
"""
if other is None:
return 1
- if self._action != other._action:
- if self._action < other._action:
+ if self.action != other.action:
+ if self.action < other.action:
return -1
else:
return 1
- if self._command != other._command:
- if self._command < other._command:
+ if self.command != other.command:
+ if self.command < other.command:
return -1
else:
return 1
- if self._before != other._before:
- if self._before < other._before:
+ if self.before != other.before:
+ if self.before < other.before:
return -1
else:
return 1
- if self._after != other._after:
- if self._after < other._after:
+ if self.after != other.after:
+ if self.after < other.after:
return -1
else:
return 1
@@ -817,13 +817,13 @@
"""
if other is None:
return 1
- if self._blankMode != other._blankMode:
- if self._blankMode < other._blankMode:
+ if self.blankMode != other.blankMode:
+ if self.blankMode < other.blankMode:
return -1
else:
return 1
- if self._blankFactor != other._blankFactor:
- if self._blankFactor < other._blankFactor:
+ if self.blankFactor != other.blankFactor:
+ if self.blankFactor < other.blankFactor:
return -1
else:
return 1
@@ -946,28 +946,28 @@
"""
if other is None:
return 1
- if self._name != other._name:
- if self._name < other._name:
+ if self.name != other.name:
+ if self.name < other.name:
return -1
else:
return 1
- if self._module != other._module:
- if self._module < other._module:
+ if self.module != other.module:
+ if self.module < other.module:
return -1
else:
return 1
- if self._function != other._function:
- if self._function < other._function:
+ if self.function != other.function:
+ if self.function < other.function:
return -1
else:
return 1
- if self._index != other._index:
- if self._index < other._index:
+ if self.index != other.index:
+ if self.index < other.index:
return -1
else:
return 1
- if self._dependencies != other._dependencies:
- if self._dependencies < other._dependencies:
+ if self.dependencies != other.dependencies:
+ if self.dependencies < other.dependencies:
return -1
else:
return 1
@@ -1143,13 +1143,13 @@
"""
if other is None:
return 1
- if self._command != other._command:
- if self._command < other.command:
+ if self.command != other.command:
+ if self.command < other.command:
return -1
else:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other.absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
@@ -1256,18 +1256,18 @@
"""
if other is None:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other.absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._archiveMode != other._archiveMode:
- if self._archiveMode < other._archiveMode:
+ if self.archiveMode != other.archiveMode:
+ if self.archiveMode < other.archiveMode:
return -1
else:
return 1
@@ -1387,7 +1387,7 @@
self._archiveMode = None
self._ignoreFile = None
self._linkDepth = None
- self._deference = None
+ self._dereference = None
self._absoluteExcludePaths = None
self._relativeExcludePaths = None
self._excludePatterns = None
@@ -1427,48 +1427,48 @@
"""
if other is None:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other.absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._archiveMode != other._archiveMode:
- if self._archiveMode < other._archiveMode:
+ if self.archiveMode != other.archiveMode:
+ if self.archiveMode < other.archiveMode:
return -1
else:
return 1
- if self._ignoreFile != other._ignoreFile:
- if self._ignoreFile < other._ignoreFile:
+ if self.ignoreFile != other.ignoreFile:
+ if self.ignoreFile < other.ignoreFile:
return -1
else:
return 1
- if self._linkDepth != other._linkDepth:
- if self._linkDepth < other._linkDepth:
+ if self.linkDepth != other.linkDepth:
+ if self.linkDepth < other.linkDepth:
return -1
else:
return 1
- if self._dereference != other._dereference:
- if self._dereference < other._dereference:
+ if self.dereference != other.dereference:
+ if self.dereference < other.dereference:
return -1
else:
return 1
- if self._absoluteExcludePaths != other._absoluteExcludePaths:
- if self._absoluteExcludePaths < other._absoluteExcludePaths:
+ if self.absoluteExcludePaths != other.absoluteExcludePaths:
+ if self.absoluteExcludePaths < other.absoluteExcludePaths:
return -1
else:
return 1
- if self._relativeExcludePaths != other._relativeExcludePaths:
- if self._relativeExcludePaths < other._relativeExcludePaths:
+ if self.relativeExcludePaths != other.relativeExcludePaths:
+ if self.relativeExcludePaths < other.relativeExcludePaths:
return -1
else:
return 1
- if self._excludePatterns != other._excludePatterns:
- if self._excludePatterns < other._excludePatterns:
+ if self.excludePatterns != other.excludePatterns:
+ if self.excludePatterns < other.excludePatterns:
return -1
else:
return 1
@@ -1718,13 +1718,13 @@
"""
if other is None:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other._absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
- if self._retainDays != other._retainDays:
- if self._retainDays < other._retainDays:
+ if self.retainDays != other.retainDays:
+ if self.retainDays < other.retainDays:
return -1
else:
return 1
@@ -1837,18 +1837,18 @@
"""
if other is None:
return 1
- if self._name != other._name:
- if self._name < other._name:
+ if self.name != other.name:
+ if self.name < other.name:
return -1
else:
return 1
- if self._collectDir != other._collectDir:
- if self._collectDir < other._collectDir:
+ if self.collectDir != other.collectDir:
+ if self.collectDir < other.collectDir:
return -1
else:
return 1
- if self._ignoreFailureMode != other._ignoreFailureMode:
- if self._ignoreFailureMode < other._ignoreFailureMode:
+ if self.ignoreFailureMode != other.ignoreFailureMode:
+ if self.ignoreFailureMode < other.ignoreFailureMode:
return -1
else:
return 1
@@ -2000,48 +2000,48 @@
"""
if other is None:
return 1
- if self._name != other._name:
- if self._name < other._name:
+ if self.name != other.name:
+ if self.name < other.name:
return -1
else:
return 1
- if self._collectDir != other._collectDir:
- if self._collectDir < other._collectDir:
+ if self.collectDir != other.collectDir:
+ if self.collectDir < other.collectDir:
return -1
else:
return 1
- if self._remoteUser != other._remoteUser:
- if self._remoteUser < other._remoteUser:
+ if self.remoteUser != other.remoteUser:
+ if self.remoteUser < other.remoteUser:
return -1
else:
return 1
- if self._rcpCommand != other._rcpCommand:
- if self._rcpCommand < other._rcpCommand:
+ if self.rcpCommand != other.rcpCommand:
+ if self.rcpCommand < other.rcpCommand:
return -1
else:
return 1
- if self._rshCommand != other._rshCommand:
- if self._rshCommand < other._rshCommand:
+ if self.rshCommand != other.rshCommand:
+ if self.rshCommand < other.rshCommand:
return -1
else:
return 1
- if self._cbackCommand != other._cbackCommand:
- if self._cbackCommand < other._cbackCommand:
+ if self.cbackCommand != other.cbackCommand:
+ if self.cbackCommand < other.cbackCommand:
return -1
else:
return 1
- if self._managed != other._managed:
- if self._managed < other._managed:
+ if self.managed != other.managed:
+ if self.managed < other.managed:
return -1
else:
return 1
- if self._managedActions != other._managedActions:
- if self._managedActions < other._managedActions:
+ if self.managedActions != other.managedActions:
+ if self.managedActions < other.managedActions:
return -1
else:
return 1
- if self._ignoreFailureMode != other._ignoreFailureMode:
- if self._ignoreFailureMode < other._ignoreFailureMode:
+ if self.ignoreFailureMode != other.ignoreFailureMode:
+ if self.ignoreFailureMode < other.ignoreFailureMode:
return -1
else:
return 1
@@ -2277,23 +2277,23 @@
"""
if other is None:
return 1
- if self._author != other._author:
- if self._author < other._author:
+ if self.author != other.author:
+ if self.author < other.author:
return -1
else:
return 1
- if self._revision != other._revision:
- if self._revision < other._revision:
+ if self.revision != other.revision:
+ if self.revision < other.revision:
return -1
else:
return 1
- if self._description != other._description:
- if self._description < other._description:
+ if self.description != other.description:
+ if self.description < other.description:
return -1
else:
return 1
- if self._generator != other._generator:
- if self._generator < other._generator:
+ if self.generator != other.generator:
+ if self.generator < other.generator:
return -1
else:
return 1
@@ -2417,13 +2417,13 @@
"""
if other is None:
return 1
- if self._orderMode != other._orderMode:
- if self._orderMode < other._orderMode:
+ if self.orderMode != other.orderMode:
+ if self.orderMode < other.orderMode:
return -1
else:
return 1
- if self._actions != other._actions:
- if self._actions < other._actions:
+ if self.actions != other.actions:
+ if self.actions < other.actions:
return -1
else:
return 1
@@ -2570,53 +2570,53 @@
"""
if other is None:
return 1
- if self._startingDay != other._startingDay:
- if self._startingDay < other._startingDay:
+ if self.startingDay != other.startingDay:
+ if self.startingDay < other.startingDay:
return -1
else:
return 1
- if self._workingDir != other._workingDir:
- if self._workingDir < other._workingDir:
+ if self.workingDir != other.workingDir:
+ if self.workingDir < other.workingDir:
return -1
else:
return 1
- if self._backupUser != other._backupUser:
- if self._backupUser < other._backupUser:
+ if self.backupUser != other.backupUser:
+ if self.backupUser < other.backupUser:
return -1
else:
return 1
- if self._backupGroup != other._backupGroup:
- if self._backupGroup < other._backupGroup:
+ if self.backupGroup != other.backupGroup:
+ if self.backupGroup < other.backupGroup:
return -1
else:
return 1
- if self._rcpCommand != other._rcpCommand:
- if self._rcpCommand < other._rcpCommand:
+ if self.rcpCommand != other.rcpCommand:
+ if self.rcpCommand < other.rcpCommand:
return -1
else:
return 1
- if self._rshCommand != other._rshCommand:
- if self._rshCommand < other._rshCommand:
+ if self.rshCommand != other.rshCommand:
+ if self.rshCommand < other.rshCommand:
return -1
else:
return 1
- if self._cbackCommand != other._cbackCommand:
- if self._cbackCommand < other._cbackCommand:
+ if self.cbackCommand != other.cbackCommand:
+ if self.cbackCommand < other.cbackCommand:
return -1
else:
return 1
- if self._overrides != other._overrides:
- if self._overrides < other._overrides:
+ if self.overrides != other.overrides:
+ if self.overrides < other.overrides:
return -1
else:
return 1
- if self._hooks != other._hooks:
- if self._hooks < other._hooks:
+ if self.hooks != other.hooks:
+ if self.hooks < other.hooks:
return -1
else:
return 1
- if self._managedActions != other._managedActions:
- if self._managedActions < other._managedActions:
+ if self.managedActions != other.managedActions:
+ if self.managedActions < other.managedActions:
return -1
else:
return 1
@@ -2926,13 +2926,13 @@
"""
if other is None:
return 1
- if self._localPeers != other._localPeers:
- if self._localPeers < other._localPeers:
+ if self.localPeers != other.localPeers:
+ if self.localPeers < other.localPeers:
return -1
else:
return 1
- if self._remotePeers != other._remotePeers:
- if self._remotePeers < other._remotePeers:
+ if self.remotePeers != other.remotePeers:
+ if self.remotePeers < other.remotePeers:
return -1
else:
return 1
@@ -3093,43 +3093,43 @@
"""
if other is None:
return 1
- if self._targetDir != other._targetDir:
- if self._targetDir < other._targetDir:
+ if self.targetDir != other.targetDir:
+ if self.targetDir < other.targetDir:
return -1
else:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._archiveMode != other._archiveMode:
- if self._archiveMode < other._archiveMode:
+ if self.archiveMode != other.archiveMode:
+ if self.archiveMode < other.archiveMode:
return -1
else:
return 1
- if self._ignoreFile != other._ignoreFile:
- if self._ignoreFile < other._ignoreFile:
+ if self.ignoreFile != other.ignoreFile:
+ if self.ignoreFile < other.ignoreFile:
return -1
else:
return 1
- if self._absoluteExcludePaths != other._absoluteExcludePaths:
- if self._absoluteExcludePaths < other._absoluteExcludePaths:
+ if self.absoluteExcludePaths != other.absoluteExcludePaths:
+ if self.absoluteExcludePaths < other.absoluteExcludePaths:
return -1
else:
return 1
- if self._excludePatterns != other._excludePatterns:
- if self._excludePatterns < other._excludePatterns:
+ if self.excludePatterns != other.excludePatterns:
+ if self.excludePatterns < other.excludePatterns:
return -1
else:
return 1
- if self._collectFiles != other._collectFiles:
- if self._collectFiles < other._collectFiles:
+ if self.collectFiles != other.collectFiles:
+ if self.collectFiles < other.collectFiles:
return -1
else:
return 1
- if self._collectDirs != other._collectDirs:
- if self._collectDirs < other._collectDirs:
+ if self.collectDirs != other.collectDirs:
+ if self.collectDirs < other.collectDirs:
return -1
else:
return 1
@@ -3371,18 +3371,18 @@
"""
if other is None:
return 1
- if self._targetDir != other._targetDir:
- if self._targetDir < other._targetDir:
+ if self.targetDir != other.targetDir:
+ if self.targetDir < other.targetDir:
return -1
else:
return 1
- if self._localPeers != other._localPeers:
- if self._localPeers < other._localPeers:
+ if self.localPeers != other.localPeers:
+ if self.localPeers < other.localPeers:
return -1
else:
return 1
- if self._remotePeers != other._remotePeers:
- if self._remotePeers < other._remotePeers:
+ if self.remotePeers != other.remotePeers:
+ if self.remotePeers < other.remotePeers:
return -1
else:
return 1
@@ -3553,10 +3553,11 @@
"""
Official string representation for class instance.
"""
- return "StoreConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.sourceDir, self.mediaType, self.deviceType,
- self.devicePath, self.deviceScsiId, self.driveSpeed,
- self.checkData, self.warnMidnite, self.noEject,
- self.checkMedia, self.blankBehavior, self.refreshMediaDelay)
+ return "StoreConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (
+ self.sourceDir, self.mediaType, self.deviceType,
+ self.devicePath, self.deviceScsiId, self.driveSpeed,
+ self.checkData, self.warnMidnite, self.noEject,
+ self.checkMedia, self.blankBehavior, self.refreshMediaDelay)
def __str__(self):
"""
@@ -3572,63 +3573,63 @@
"""
if other is None:
return 1
- if self._sourceDir != other._sourceDir:
- if self._sourceDir < other._sourceDir:
+ if self.sourceDir != other.sourceDir:
+ if self.sourceDir < other.sourceDir:
return -1
else:
return 1
- if self._mediaType != other._mediaType:
- if self._mediaType < other._mediaType:
+ if self.mediaType != other.mediaType:
+ if self.mediaType < other.mediaType:
return -1
else:
return 1
- if self._deviceType != other._deviceType:
- if self._deviceType < other._deviceType:
+ if self.deviceType != other.deviceType:
+ if self.deviceType < other.deviceType:
return -1
else:
return 1
- if self._devicePath != other._devicePath:
- if self._devicePath < other._devicePath:
+ if self.devicePath != other.devicePath:
+ if self.devicePath < other.devicePath:
return -1
else:
return 1
- if self._deviceScsiId != other._deviceScsiId:
- if self._deviceScsiId < other._deviceScsiId:
+ if self.deviceScsiId != other.deviceScsiId:
+ if self.deviceScsiId < other.deviceScsiId:
return -1
else:
return 1
- if self._driveSpeed != other._driveSpeed:
- if self._driveSpeed < other._driveSpeed:
+ if self.driveSpeed != other.driveSpeed:
+ if self.driveSpeed < other.driveSpeed:
return -1
else:
return 1
- if self._checkData != other._checkData:
- if self._checkData < other._checkData:
+ if self.checkData != other.checkData:
+ if self.checkData < other.checkData:
return -1
else:
return 1
- if self._checkMedia != other._checkMedia:
- if self._checkMedia < other._checkMedia:
+ if self.checkMedia != other.checkMedia:
+ if self.checkMedia < other.checkMedia:
return -1
else:
return 1
- if self._warnMidnite != other._warnMidnite:
- if self._warnMidnite < other._warnMidnite:
+ if self.warnMidnite != other.warnMidnite:
+ if self.warnMidnite < other.warnMidnite:
return -1
else:
return 1
- if self._noEject != other._noEject:
- if self._noEject < other._noEject:
+ if self.noEject != other.noEject:
+ if self.noEject < other.noEject:
return -1
else:
return 1
- if self._blankBehavior != other._blankBehavior:
- if self._blankBehavior < other._blankBehavior:
+ if self.blankBehavior != other.blankBehavior:
+ if self.blankBehavior < other.blankBehavior:
return -1
else:
return 1
- if self._refreshMediaDelay != other._refreshMediaDelay:
- if self._refreshMediaDelay < other._refreshMediaDelay:
+ if self.refreshMediaDelay != other.refreshMediaDelay:
+ if self.refreshMediaDelay < other.refreshMediaDelay:
return -1
else:
return 1
@@ -3917,8 +3918,8 @@
"""
if other is None:
return 1
- if self._purgeDirs != other._purgeDirs:
- if self._purgeDirs < other._purgeDirs:
+ if self.purgeDirs != other.purgeDirs:
+ if self.purgeDirs < other.purgeDirs:
return -1
else:
return 1
@@ -4098,43 +4099,43 @@
"""
if other is None:
return 1
- if self._reference != other._reference:
- if self._reference < other._reference:
+ if self.reference != other.reference:
+ if self.reference < other.reference:
return -1
else:
return 1
- if self._extensions != other._extensions:
- if self._extensions < other._extensions:
+ if self.extensions != other.extensions:
+ if self.extensions < other.extensions:
return -1
else:
return 1
- if self._options != other._options:
- if self._options < other._options:
+ if self.options != other.options:
+ if self.options < other.options:
return -1
else:
return 1
- if self._peers != other._peers:
- if self._peers < other._peers:
+ if self.peers != other.peers:
+ if self.peers < other.peers:
return -1
else:
return 1
- if self._collect != other._collect:
- if self._collect < other._collect:
+ if self.collect != other.collect:
+ if self.collect < other.collect:
return -1
else:
return 1
- if self._stage != other._stage:
- if self._stage < other._stage:
+ if self.stage != other.stage:
+ if self.stage < other.stage:
return -1
else:
return 1
- if self._store != other._store:
- if self._store < other._store:
+ if self.store != other.store:
+ if self.store < other.store:
return -1
else:
return 1
- if self._purge != other._purge:
- if self._purge < other._purge:
+ if self.purge != other.purge:
+ if self.purge < other.purge:
return -1
else:
return 1
@@ -4578,9 +4579,9 @@
collectFiles //cb_config/collect/file
collectDirs //cb_config/collect/dir
- The exclusions are parsed by L{_parseExclusions}, the collect files are
- parsed by L{_parseCollectFiles}, and the directories are parsed by
- L{_parseCollectDirs}.
+ The exclusions are parsed by L{_parseExclusions}, the collect files are
+ parsed by L{_parseCollectFiles}, and the directories are parsed by
+ L{_parseCollectDirs}.
@param parentNode: Parent node to search beneath.
@@ -4727,7 +4728,7 @@
action.function = readString(entry, "function")
action.index = readInteger(entry, "index")
action.dependencies = Config._parseDependencies(entry)
- lst.append(action);
+ lst.append(action)
if lst == []:
lst = None
return lst
@@ -4823,38 +4824,38 @@
_parseHooks = staticmethod(_parseHooks)
def _parseCollectFiles(parentNode):
- """
- Reads a list of C{CollectFile} objects from immediately beneath the parent.
+ """
+ Reads a list of C{CollectFile} objects from immediately beneath the parent.
- We read the following individual fields::
+ We read the following individual fields::
- absolutePath abs_path
- collectMode mode I{or} collect_mode
- archiveMode archive_mode
+ absolutePath abs_path
+ collectMode mode I{or} collect_mode
+ archiveMode archive_mode
- The collect mode is a special case. Just a C{mode} tag is accepted, but
- we prefer C{collect_mode} for consistency with the rest of the config
- file and to avoid confusion with the archive mode. If both are provided,
- only C{mode} will be used.
+ The collect mode is a special case. Just a C{mode} tag is accepted, but
+ we prefer C{collect_mode} for consistency with the rest of the config
+ file and to avoid confusion with the archive mode. If both are provided,
+ only C{mode} will be used.
- @param parentNode: Parent node to search beneath.
+ @param parentNode: Parent node to search beneath.
- @return: List of C{CollectFile} objects or C{None} if none are found.
- @raise ValueError: If some filled-in value is invalid.
- """
- lst = []
- for entry in readChildren(parentNode, "file"):
- if isElement(entry):
- cfile = CollectFile()
- cfile.absolutePath = readString(entry, "abs_path")
- cfile.collectMode = readString(entry, "mode")
- if cfile.collectMode is None:
- cfile.collectMode = readString(entry, "collect_mode")
- cfile.archiveMode = readString(entry, "archive_mode")
- lst.append(cfile)
- if lst == []:
- lst = None
- return lst
+ @return: List of C{CollectFile} objects or C{None} if none are found.
+ @raise ValueError: If some filled-in value is invalid.
+ """
+ lst = []
+ for entry in readChildren(parentNode, "file"):
+ if isElement(entry):
+ cfile = CollectFile()
+ cfile.absolutePath = readString(entry, "abs_path")
+ cfile.collectMode = readString(entry, "mode")
+ if cfile.collectMode is None:
+ cfile.collectMode = readString(entry, "collect_mode")
+ cfile.archiveMode = readString(entry, "archive_mode")
+ lst.append(cfile)
+ if lst == []:
+ lst = None
+ return lst
_parseCollectFiles = staticmethod(_parseCollectFiles)
def _parseCollectDirs(parentNode):
@@ -5484,33 +5485,33 @@
_addHook = staticmethod(_addHook)
def _addCollectFile(xmlDom, parentNode, collectFile):
- """
- Adds a collect file container as the next child of a parent.
+ """
+ Adds a collect file container as the next child of a parent.
- We add the following fields to the document::
+ We add the following fields to the document::
- absolutePath dir/abs_path
- collectMode dir/collect_mode
- archiveMode dir/archive_mode
+ absolutePath dir/abs_path
+ collectMode dir/collect_mode
+ archiveMode dir/archive_mode
- Note that for consistency with collect directory handling we'll only emit
- the preferred C{collect_mode} tag.
+ Note that for consistency with collect directory handling we'll only emit
+ the preferred C{collect_mode} tag.
- The <file> node itself is created as the next child of the parent node.
- This method only adds one collect file node. The parent must loop
- for each collect file in the C{CollectConfig} object.
+ The <file> node itself is created as the next child of the parent node.
+ This method only adds one collect file node. The parent must loop
+ for each collect file in the C{CollectConfig} object.
- If C{collectFile} is C{None}, this method call will be a no-op.
+ If C{collectFile} is C{None}, this method call will be a no-op.
- @param xmlDom: DOM tree as from L{createOutputDom}.
- @param parentNode: Parent that the section should be appended to.
- @param collectFile: Collect file to be added to the document.
- """
- if collectFile is not None:
- sectionNode = addContainerNode(xmlDom, parentNode, "file")
- addStringNode(xmlDom, sectionNode, "abs_path", collectFile.absolutePath)
- addStringNode(xmlDom, sectionNode, "collect_mode", collectFile.collectMode)
- addStringNode(xmlDom, sectionNode, "archive_mode", collectFile.archiveMode)
+ @param xmlDom: DOM tree as from L{createOutputDom}.
+ @param parentNode: Parent that the section should be appended to.
+ @param collectFile: Collect file to be added to the document.
+ """
+ if collectFile is not None:
+ sectionNode = addContainerNode(xmlDom, parentNode, "file")
+ addStringNode(xmlDom, sectionNode, "abs_path", collectFile.absolutePath)
+ addStringNode(xmlDom, sectionNode, "collect_mode", collectFile.collectMode)
+ addStringNode(xmlDom, sectionNode, "archive_mode", collectFile.archiveMode)
_addCollectFile = staticmethod(_addCollectFile)
def _addCollectDir(xmlDom, parentNode, collectDir):
@@ -6066,7 +6067,7 @@
units = UNIT_KBYTES
elif data.endswith("MB"):
quantity = data[0:data.rfind("MB")].strip()
- units = UNIT_MBYTES;
+ units = UNIT_MBYTES
elif data.endswith("GB"):
quantity = data[0:data.rfind("GB")].strip()
units = UNIT_GBYTES
Modified: cedar-backup2/trunk/CedarBackup2/extend/capacity.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/capacity.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -123,8 +123,8 @@
"""
if other is None:
return 1
- if self._quantity != other._quantity:
- if self._quantity < other._quantity:
+ if self.quantity != other.quantity:
+ if self.quantity < other.quantity:
return -1
else:
return 1
@@ -214,13 +214,13 @@
"""
if other is None:
return 1
- if self._maxPercentage != other._maxPercentage:
- if self._maxPercentage < other._maxPercentage:
+ if self.maxPercentage != other.maxPercentage:
+ if self.maxPercentage < other.maxPercentage:
return -1
else:
return 1
- if self._minBytes != other._minBytes:
- if self._minBytes < other._minBytes:
+ if self.minBytes != other.minBytes:
+ if self.minBytes < other.minBytes:
return -1
else:
return 1
@@ -358,8 +358,8 @@
"""
if other is None:
return 1
- if self._capacity != other._capacity:
- if self._capacity < other._capacity:
+ if self.capacity != other.capacity:
+ if self.capacity < other.capacity:
return -1
else:
return 1
Modified: cedar-backup2/trunk/CedarBackup2/extend/encrypt.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/encrypt.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -62,7 +62,6 @@
import logging
# Cedar Backup modules
-from CedarBackup2.filesystem import FilesystemList
from CedarBackup2.util import resolveCommand, executeCommand, changeOwnership
from CedarBackup2.xmlutil import createInputDom, addContainerNode, addStringNode
from CedarBackup2.xmlutil import readFirstChild, readString
@@ -134,13 +133,13 @@
"""
if other is None:
return 1
- if self._encryptMode != other._encryptMode:
- if self._encryptMode < other._encryptMode:
+ if self.encryptMode != other.encryptMode:
+ if self.encryptMode < other.encryptMode:
return -1
else:
return 1
- if self._encryptTarget != other._encryptTarget:
- if self._encryptTarget < other._encryptTarget:
+ if self.encryptTarget != other.encryptTarget:
+ if self.encryptTarget < other.encryptTarget:
return -1
else:
return 1
@@ -272,8 +271,8 @@
"""
if other is None:
return 1
- if self._encrypt != other._encrypt:
- if self._encrypt < other._encrypt:
+ if self.encrypt != other.encrypt:
+ if self.encrypt < other.encrypt:
return -1
else:
return 1
@@ -404,7 +403,7 @@
raise ValueError("Cedar Backup configuration is not properly filled in.")
local = LocalConfig(xmlPath=configPath)
if local.encrypt.encryptMode not in ["gpg", ]:
- raise ValueError("Unknown encrypt mode [%s]" % local.encrypt.encryptMode);
+ raise ValueError("Unknown encrypt mode [%s]" % local.encrypt.encryptMode)
if local.encrypt.encryptMode == "gpg":
_confirmGpgRecipient(local.encrypt.encryptTarget)
dailyDirs = findDailyDirs(config.stage.targetDir, ENCRYPT_INDICATOR)
@@ -469,11 +468,11 @@
@raise IOError: If there is a problem accessing, encrypting or removing the source file.
"""
if not os.path.exists(sourcePath):
- raise ValueError("Source path [%s] does not exist." % sourcePath);
+ raise ValueError("Source path [%s] does not exist." % sourcePath)
if encryptMode == 'gpg':
encryptedPath = _encryptFileWithGpg(sourcePath, recipient=encryptTarget)
else:
- raise ValueError("Unknown encrypt mode [%s]" % encryptMode);
+ raise ValueError("Unknown encrypt mode [%s]" % encryptMode)
changeOwnership(encryptedPath, backupUser, backupGroup)
if removeSource:
if os.path.exists(sourcePath):
Modified: cedar-backup2/trunk/CedarBackup2/extend/mbox.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/mbox.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -173,18 +173,18 @@
"""
if other is None:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other._absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._compressMode != other._compressMode:
- if self._compressMode < other._compressMode:
+ if self.compressMode != other.compressMode:
+ if self.compressMode < other.compressMode:
return -1
else:
return 1
@@ -317,28 +317,28 @@
"""
if other is None:
return 1
- if self._absolutePath != other._absolutePath:
- if self._absolutePath < other._absolutePath:
+ if self.absolutePath != other.absolutePath:
+ if self.absolutePath < other.absolutePath:
return -1
else:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._compressMode != other._compressMode:
- if self._compressMode < other._compressMode:
+ if self.compressMode != other.compressMode:
+ if self.compressMode < other.compressMode:
return -1
else:
return 1
- if self._relativeExcludePaths != other._relativeExcludePaths:
- if self._relativeExcludePaths < other._relativeExcludePaths:
+ if self.relativeExcludePaths != other.relativeExcludePaths:
+ if self.relativeExcludePaths < other.relativeExcludePaths:
return -1
else:
return 1
- if self._excludePatterns != other._excludePatterns:
- if self._excludePatterns < other._excludePatterns:
+ if self.excludePatterns != other.excludePatterns:
+ if self.excludePatterns < other.excludePatterns:
return -1
else:
return 1
@@ -521,23 +521,23 @@
"""
if other is None:
return 1
- if self._collectMode != other._collectMode:
- if self._collectMode < other._collectMode:
+ if self.collectMode != other.collectMode:
+ if self.collectMode < other.collectMode:
return -1
else:
return 1
- if self._compressMode != other._compressMode:
- if self._compressMode < other._compressMode:
+ if self.compressMode != other.compressMode:
+ if self.compressMode < other.compressMode:
return -1
else:
return 1
- if self._mboxFiles != other._mboxFiles:
- if self._mboxFiles < other._mboxFiles:
+ if self.mboxFiles != other.mboxFiles:
+ if self.mboxFiles < other.mboxFiles:
return -1
else:
return 1
- if self._mboxDirs != other._mboxDirs:
- if self._mboxDirs < other._mboxDirs:
+ if self.mboxDirs != other.mboxDirs:
+ if self.mboxDirs < other.mboxDirs:
return -1
else:
return 1
@@ -719,8 +719,8 @@
"""
if other is None:
return 1
- if self._mbox != other._mbox:
- if self._mbox < other._mbox:
+ if self.mbox != other.mbox:
+ if self.mbox < other.mbox:
return -1
else:
return 1
Modified: cedar-backup2/trunk/CedarBackup2/extend/mysql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/mysql.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -94,8 +94,8 @@
# Cedar Backup modules
from CedarBackup2.xmlutil import createInputDom, addContainerNode, addStringNode, addBooleanNode
-from CedarBackup2.xmlutil import readChildren, readFirstChild, readString, readStringList, readBoolean
-from CedarBackup2.config import VALID_COLLECT_MODES, VALID_COMPRESS_MODES
+from CedarBackup2.xmlutil import readFirstChild, readString, readStringList, readBoolean
+from CedarBackup2.config import VALID_COMPRESS_MODES
from CedarBackup2.util import resolveCommand, executeCommand
from CedarBackup2.util import ObjectTypeList, changeOwnership
@@ -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):
+ def __init__(self, user=None, password=None, compressMode=None, all=None, databases=None): # pylint: disable-msg=W0622
"""
Constructor for the C{MysqlConfig} class.
@@ -170,28 +170,28 @@
"""
if other is None:
return 1
- if self._user != other._user:
- if self._user < other._user:
+ if self.user != other.user:
+ if self.user < other.user:
return -1
else:
return 1
- if self._password != other._password:
- if self._password < other._password:
+ if self.password != other.password:
+ if self.password < other.password:
return -1
else:
return 1
- if self._compressMode != other._compressMode:
- if self._compressMode < other._compressMode:
+ if self.compressMode != other.compressMode:
+ if self.compressMode < other.compressMode:
return -1
else:
return 1
- if self._all != other._all:
- if self._all < other._all:
+ if self.all != other.all:
+ if self.all < other.all:
return -1
else:
return 1
- if self._databases != other._databases:
- if self._databases < other._databases:
+ if self.databases != other.databases:
+ if self.databases < other.databases:
return -1
else:
return 1
@@ -383,8 +383,8 @@
"""
if other is None:
return 1
- if self._mysql != other._mysql:
- if self._mysql < other._mysql:
+ if self.mysql != other.mysql:
+ if self.mysql < other.mysql:
return -1
else:
return 1
Modified: cedar-backup2/trunk/CedarBackup2/extend/postgresql.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/postgresql.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -84,8 +84,8 @@
# Cedar Backup modules
from CedarBackup2.xmlutil import createInputDom, addContainerNode, addStringNode, addBooleanNode
-from CedarBackup2.xmlutil import readChildren, readFirstChild, readString, readStringList, readBoolean
-from CedarBackup2.config import VALID_COLLECT_MODES, VALID_COMPRESS_MODES
+from CedarBackup2.xmlutil import readFirstChild, readString, readStringList, readBoolean
+from CedarBackup2.config import VALID_COMPRESS_MODES
from CedarBackup2.util import resolveCommand, executeCommand
from CedarBackup2.util import ObjectTypeList, changeOwnership
@@ -120,7 +120,7 @@
@sort: __init__, __repr__, __str__, __cmp__, user, all, databases
"""
- def __init__(self, user=None, compressMode=None, all=None, databases=None):
+ def __init__(self, user=None, compressMode=None, all=None, databases=None): # pylint: disable-msg=W0622
"""
Constructor for the C{PostgresqlConfig} class.
@@ -158,23 +158,23 @@
"""
if other is None:
return 1
- if self._user != other._user:
- if self._user < other._user:
+ if self.user != other.user:
+ if self.user < other.user:
return -1
else:
return 1
- if self._compressMode != other._compressMode:
- if self._compressMode < other._compressMode:
+ if self.compressMode != other.compressMode:
+ if self.compressMode < other.compressMode:
return -1
else:
return 1
- if self._all != other._all:
- if self._all < other._all:
+ if self.all != other.all:
+ if self.all < other.all:
return -1
else:
return 1
- if self._databases != other._databases:
- if self._databases < other._databases:
+ if self.databases != other.databases:
+ if self.databases < other.databases:
return -1
else:
return 1
@@ -350,8 +350,8 @@
"""
if other is None:
return 1
- if self._postgresql != other._postgresql:
- if self._postgresql < other._postgresql:
+ if self.postgresql != other.postgresql:
+ if self.postgresql < other.postgresql:
return -1
else:
return 1
Modified: cedar-backup2/trunk/CedarBackup2/extend/split.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-06-30 01:19:43 UTC (rev 978)
+++ cedar-backup2/trunk/CedarBackup2/extend/split.py 2010-06-30 22:54:17 UTC (rev 979)
@@ -64,12 +64,9 @@
import logging
# Cedar Backup modules
-from CedarBackup2.filesystem import FilesystemList
-from CedarBackup2.util import resolveCommand, executeCommand
-from CedarBackup2.util import changeOwnership, buildNormalizedPath
-from CedarBackup2.util import UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES
-from CedarBackup2.xmlutil import createInputDom, addContainerNode, addStringNode
-from CedarBackup2.xmlutil import readFirstChild, readString
+from CedarBackup2.util import resolveCommand, executeCommand, changeOwnership
+from CedarBackup2.xmlutil import createInputDom, addContainerNode
+from CedarBackup2.xmlutil import readFirstChild
from CedarBackup2.actions.util import findDailyDirs, writeIndicatorFile, getBackupFiles
from CedarBackup2.config import ByteQuantity, readByteQuantity, addByteQuantityNode
@@ -138,13 +135,13 @@
"""
if other is None:
return 1
- if self._sizeLimit != other._sizeLimit:
- if self._sizeLimit < other._sizeLimit:
+ if self.sizeLimit != other.sizeLimit:
+ if self.sizeLimit < other.sizeLimit:
return -1
else:
return 1
- if self._splitSize != other._splitSize:
- if self._splitSize < other._splitSize:
+ if self.splitSize != other.splitSize:
+ if self.splitSize < other.sp...
[truncated message content] |
|
From: <pro...@us...> - 2010-06-30 01:19:50
|
Revision: 978
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=978&view=rev
Author: pronovic
Date: 2010-06-30 01:19:43 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Fix minor pychecker warnings
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -2633,8 +2633,8 @@
self.overrides = [ override, ]
else:
exists = False
- for object in self.overrides:
- if object.command == override.command:
+ for obj in self.overrides:
+ if obj.command == override.command:
exists = True
break
if not exists:
@@ -2651,10 +2651,10 @@
self.overrides = [ override, ]
else:
exists = False
- for object in self.overrides:
- if object.command == override.command:
+ for obj in self.overrides:
+ if obj.command == override.command:
exists = True
- object.absolutePath = override.absolutePath
+ obj.absolutePath = override.absolutePath
break
if not exists:
self.overrides.append(override)
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -495,7 +495,7 @@
"""
print ""
_discInitializeImage(config, writer, spanItem)
- _discWriteImage(config, writer, spanItem)
+ _discWriteImage(config, writer)
_discConsistencyCheck(config, writer, spanItem)
print "Write process is complete."
print "==="
@@ -526,12 +526,11 @@
print "==="
print "Completed initializing image."
-def _discWriteImage(config, writer, spanItem):
+def _discWriteImage(config, writer):
"""
Writes a ISO image for a span item.
@param config: Cedar Backup configuration
@param writer: Writer to use
- @param spanItem: Span item to write
"""
complete = False
while not complete:
@@ -574,7 +573,7 @@
print "Ok, attempting retry."
_getReturn("Please replace the disc in your backup device.\nPress return when ready.")
print "==="
- _discWriteImage(config, writer, spanItem)
+ _discWriteImage(config, writer)
else:
print "Ok, attempting retry."
print "==="
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -59,6 +59,7 @@
import re
import logging
import tempfile
+import time
# Cedar Backup modules
from CedarBackup2.filesystem import FilesystemList
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/Changelog 2010-06-30 01:19:43 UTC (rev 978)
@@ -1,3 +1,7 @@
+Version 2.19.7 unreleased
+
+ * Fix minor Pychecker warnings.
+
Version 2.19.6 22 May 2010
* Work around strange stderr file descriptor bugs discovered on Cygwin.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|