From 2229f7c383e63da7688f8362e80a05079a30dff9 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 1 Aug 2002 04:57:04 +0000 Subject: Fixed --verbosity in Main, added something to lazy?, fixed exception in rpath.py. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@178 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/Main.py | 2 +- rdiff-backup/rdiff_backup/lazy.py | 19 +++++++++++-------- rdiff-backup/rdiff_backup/rpath.py | 6 ++++-- rdiff-backup/src/Main.py | 2 +- rdiff-backup/src/lazy.py | 19 +++++++++++-------- rdiff-backup/src/rpath.py | 6 ++++-- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index 06a1285..a7c9ecf 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -54,7 +54,7 @@ def parse_cmdlineoptions(arglist): "restrict=", "restrict-read-only=", "restrict-update-only=", "resume", "resume-window=", "server", "sleep-ratio=", "ssh-no-compression", "terminal-verbosity=", "test-server", - "verbosity", "version", "windows-mode", + "verbosity=", "version", "windows-mode", "windows-time-format"]) except getopt.error, e: commandline_error("Bad commandline options: %s" % str(e)) diff --git a/rdiff-backup/rdiff_backup/lazy.py b/rdiff-backup/rdiff_backup/lazy.py index 5020ed2..4c32b5d 100644 --- a/rdiff-backup/rdiff_backup/lazy.py +++ b/rdiff-backup/rdiff_backup/lazy.py @@ -204,13 +204,6 @@ class IterTreeReducer: iterator nature of the connection between hosts and the temporal order in which the files are processed. - There are three stub functions below: start_process, end_process, - and branch_process. A class that subclasses this one will - probably fill in these functions to do more. - - It is important that this class be pickable, so keep that in mind - when subclassing (this is used to resume failed sessions). - """ def __init__(self, branch_class, branch_args): """ITR initializer""" @@ -299,7 +292,17 @@ class IterTreeReducer: class ITRBranch: - """Helper class for IterTreeReducer below""" + """Helper class for IterTreeReducer below + + There are five stub functions below: start_process, end_process, + branch_process, can_fast_process, and fast_process. A class that + subclasses this one will probably fill in these functions to do + more. + + It is important that this class be pickable, so keep that in mind + when subclassing (this is used to resume failed sessions). + + """ base_index = index = None finished = None caught_exception = start_successful = None diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 6f9734f..bfe613d 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -775,7 +775,7 @@ class RPath(RORPath): """Make a special file with specified type, and major/minor nums""" cmdlist = ['mknod', self.path, type, str(major), str(minor)] if self.conn.os.spawnvp(os.P_WAIT, 'mknod', cmdlist) != 0: - RPathException("Error running %s" % cmdlist) + raise RPathException("Error running %s" % cmdlist) if type == 'c': datatype = 'chr' elif type == 'b': datatype = 'blk' else: raise RPathException @@ -818,4 +818,6 @@ class RpathDeleter(ITRBranch): if self.dsrp.isdir(): self.dsrp.rmdir() else: self.dsrp.delete() - + def can_fast_process(self, index, dsrp): return not dsrp.isdir() + def fast_process(self, index, dsrp): dsrp.delete() + diff --git a/rdiff-backup/src/Main.py b/rdiff-backup/src/Main.py index 06a1285..a7c9ecf 100644 --- a/rdiff-backup/src/Main.py +++ b/rdiff-backup/src/Main.py @@ -54,7 +54,7 @@ def parse_cmdlineoptions(arglist): "restrict=", "restrict-read-only=", "restrict-update-only=", "resume", "resume-window=", "server", "sleep-ratio=", "ssh-no-compression", "terminal-verbosity=", "test-server", - "verbosity", "version", "windows-mode", + "verbosity=", "version", "windows-mode", "windows-time-format"]) except getopt.error, e: commandline_error("Bad commandline options: %s" % str(e)) diff --git a/rdiff-backup/src/lazy.py b/rdiff-backup/src/lazy.py index 5020ed2..4c32b5d 100644 --- a/rdiff-backup/src/lazy.py +++ b/rdiff-backup/src/lazy.py @@ -204,13 +204,6 @@ class IterTreeReducer: iterator nature of the connection between hosts and the temporal order in which the files are processed. - There are three stub functions below: start_process, end_process, - and branch_process. A class that subclasses this one will - probably fill in these functions to do more. - - It is important that this class be pickable, so keep that in mind - when subclassing (this is used to resume failed sessions). - """ def __init__(self, branch_class, branch_args): """ITR initializer""" @@ -299,7 +292,17 @@ class IterTreeReducer: class ITRBranch: - """Helper class for IterTreeReducer below""" + """Helper class for IterTreeReducer below + + There are five stub functions below: start_process, end_process, + branch_process, can_fast_process, and fast_process. A class that + subclasses this one will probably fill in these functions to do + more. + + It is important that this class be pickable, so keep that in mind + when subclassing (this is used to resume failed sessions). + + """ base_index = index = None finished = None caught_exception = start_successful = None diff --git a/rdiff-backup/src/rpath.py b/rdiff-backup/src/rpath.py index 6f9734f..bfe613d 100644 --- a/rdiff-backup/src/rpath.py +++ b/rdiff-backup/src/rpath.py @@ -775,7 +775,7 @@ class RPath(RORPath): """Make a special file with specified type, and major/minor nums""" cmdlist = ['mknod', self.path, type, str(major), str(minor)] if self.conn.os.spawnvp(os.P_WAIT, 'mknod', cmdlist) != 0: - RPathException("Error running %s" % cmdlist) + raise RPathException("Error running %s" % cmdlist) if type == 'c': datatype = 'chr' elif type == 'b': datatype = 'blk' else: raise RPathException @@ -818,4 +818,6 @@ class RpathDeleter(ITRBranch): if self.dsrp.isdir(): self.dsrp.rmdir() else: self.dsrp.delete() - + def can_fast_process(self, index, dsrp): return not dsrp.isdir() + def fast_process(self, index, dsrp): dsrp.delete() + -- cgit v1.2.1