Commit 1d7312b5 authored by bescoto's avatar bescoto

Minor cleanup


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@721 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 8d18a3c0
#!/usr/bin/python #!/usr/bin/python
# rdiff-backup-statistics -- Summarize rdiff-backup statistics files
# #
# Copyright 2005 Dean Gaudet, Ben Escoto # Copyright 2005 Dean Gaudet, Ben Escoto
# #
...@@ -19,11 +20,9 @@ ...@@ -19,11 +20,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA # USA
import profile, pstats
import os, sys, re, getopt import os, sys, re, getopt
from rdiff_backup import connection, regress, rpath, Globals, restore, Time, lazy from rdiff_backup import connection, regress, rpath, Globals, restore, \
Time, lazy
begin_time = None # Parse statistics at or after this time... begin_time = None # Parse statistics at or after this time...
end_time = None # ... and at or before this time (epoch seconds) end_time = None # ... and at or before this time (epoch seconds)
...@@ -34,7 +33,7 @@ def parse_args(): ...@@ -34,7 +33,7 @@ def parse_args():
try: optlist, args = getopt.getopt(sys.argv[1:], "", try: optlist, args = getopt.getopt(sys.argv[1:], "",
["begin-time=", "end-time=", "minimum-ratio="]) ["begin-time=", "end-time=", "minimum-ratio="])
except getopt.error, e: except getopt.error, e:
sys.exit("Bad commandline options: " + str(e)) sys.exit("Bad command line: " + str(e))
for opt, arg in optlist: for opt, arg in optlist:
if opt == "--begin-time": begin_time = Time.genstrtotime(arg) if opt == "--begin-time": begin_time = Time.genstrtotime(arg)
...@@ -43,8 +42,8 @@ def parse_args(): ...@@ -43,8 +42,8 @@ def parse_args():
else: assert 0 else: assert 0
if len(args) != 1: if len(args) != 1:
sys.exit("Usage: %s --begin-time <time> --end-time <time> <backup-dir>" sys.exit("Usage: %s --begin-time <time> --end-time <time> "
% (sys.argv[0],)) "--minimum-ratio <float> <backup-dir>" % (sys.argv[0],))
Globals.rbdir = rpath.RPath(Globals.local_connection, Globals.rbdir = rpath.RPath(Globals.local_connection,
os.path.join(args[0], 'rdiff-backup-data')) os.path.join(args[0], 'rdiff-backup-data'))
...@@ -402,6 +401,7 @@ class ReadlineBuffer: ...@@ -402,6 +401,7 @@ class ReadlineBuffer:
self.buffer.extend(split[1:]) self.buffer.extend(split[1:])
else: self.at_end = 1 else: self.at_end = 1
def sum_fst(rp_pairs): def sum_fst(rp_pairs):
"""Add the file statistics given as list of (session_rp, file_rp) pairs""" """Add the file statistics given as list of (session_rp, file_rp) pairs"""
n = len(rp_pairs) n = len(rp_pairs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment