summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/statistics.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-06-27 20:21:23 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-06-27 20:21:23 +0000
commit46cedd177d04372e1de7f67759a95c0d19d74ec3 (patch)
tree7329bcc875a4b1d45361d6bf0acb4fad16f20219 /rdiff-backup/rdiff_backup/statistics.py
parent3f44ce4239acd911683f05266934aa136538a3d9 (diff)
downloadrdiff-backup-46cedd177d04372e1de7f67759a95c0d19d74ec3.tar.gz
Directly interface to librsync instead of going through rdiff. Added
some supplementary scripts for testing. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@149 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/statistics.py')
-rw-r--r--rdiff-backup/rdiff_backup/statistics.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/rdiff-backup/rdiff_backup/statistics.py b/rdiff-backup/rdiff_backup/statistics.py
index e2546ba..e9f43dc 100644
--- a/rdiff-backup/rdiff_backup/statistics.py
+++ b/rdiff-backup/rdiff_backup/statistics.py
@@ -11,12 +11,15 @@
"""Generate and process aggregated backup information"""
from lazy import *
+import re
class StatsException(Exception): pass
class StatsObj:
"""Contains various statistics, provide string conversion functions"""
+ # used when quoting files in get_stats_line
+ space_regex = re.compile(" ")
stat_file_attrs = ('SourceFiles', 'SourceFileSize',
'MirrorFiles', 'MirrorFileSize',
@@ -71,8 +74,8 @@ class StatsObj:
filename = apply(os.path.join, index)
if use_repr:
# use repr to quote newlines in relative filename, then
- # take of leading and trailing quote.
- filename = repr(filename)[1:-1]
+ # take of leading and trailing quote and quote spaces.
+ filename = self.space_regex.sub("\\x20", repr(filename)[1:-1])
return " ".join([filename,] + file_attrs)
def set_stats_from_line(self, line):