diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-12-23 06:53:18 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-12-23 06:53:18 +0000 |
commit | 9a0da726e2172321cdc1dcd21441f4ffc41e7931 (patch) | |
tree | 7f25f848386ca501b7f08c08c21af16f0d71330c /rdiff-backup/rdiff_backup/FilenameMapping.py | |
parent | e95a61773adb2f98499cf13ff543f4249ee38226 (diff) | |
download | rdiff-backup-9a0da726e2172321cdc1dcd21441f4ffc41e7931.tar.gz |
Major refactoring - avoid use of 'from XX import *' in favor of more
normal 'import XXX' syntax. The previous way was an artifact from
earlier versions where the whole program fit in one file.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@252 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/FilenameMapping.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/FilenameMapping.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/rdiff-backup/rdiff_backup/FilenameMapping.py b/rdiff-backup/rdiff_backup/FilenameMapping.py index c160bed..e305f68 100644 --- a/rdiff-backup/rdiff_backup/FilenameMapping.py +++ b/rdiff-backup/rdiff_backup/FilenameMapping.py @@ -27,9 +27,7 @@ them over the usual 255 character limit. """ import re -from log import * -from robust import * -import Globals +import Globals, log max_filename_length = 255 @@ -55,8 +53,8 @@ def set_init_quote_vals_local(): global chars_to_quote, quoting_char chars_to_quote = Globals.chars_to_quote if len(Globals.quoting_char) != 1: - Log.FatalError("Expected single character for quoting char," - "got '%s' instead" % (Globals.quoting_char,)) + log.Log.FatalError("Expected single character for quoting char," + "got '%s' instead" % (Globals.quoting_char,)) quoting_char = Globals.quoting_char init_quoting_regexps() @@ -68,8 +66,8 @@ def init_quoting_regexps(): re.compile("[%s%s]" % (chars_to_quote, quoting_char), re.S) unquoting_regexp = re.compile("%s[0-9]{3}" % quoting_char, re.S) except re.error: - Log.FatalError("Error '%s' when processing char quote list %s" % - (re.error, chars_to_quote)) + log.Log.FatalError("Error '%s' when processing char quote list %s" % + (re.error, chars_to_quote)) def quote(path): """Return quoted version of given path @@ -95,18 +93,4 @@ def unquote_single(match): assert len(match.group()) == 4 return chr(int(match.group()[1:])) -def get_quoted_dir_children(rpath): - """For rpath directory, return list of quoted children in dir""" - if not rpath.isdir(): return [] - dir_pairs = [(unquote(filename), filename) - for filename in Robust.listrp(rpath)] - dir_pairs.sort() # sort by real index, not quoted part - child_list = [] - for unquoted, filename in dir_pairs: - childrp = rpath.append(unquoted) - childrp.quote_path() - child_list.append(childrp) - return child_list - - |