From cc084d25353bf98ce7ed11846a019d6c78bcb552 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 16 Dec 2004 09:22:39 +0000 Subject: [PATCH] Removed some XXXes and allowed other separators than /. --- src/utils.py | 29 ++++++++++++++++++++++++----- test/test_utils.py | 8 ++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/utils.py b/src/utils.py index cc05b880b..b5e1a82ce 100755 --- a/src/utils.py +++ b/src/utils.py @@ -214,16 +214,33 @@ def quoted(s): """Returns a quoted s.""" return '"%s"' % s -nonEscapedSlashes = re.compile(r'(?= 2 + if s.startswith('m') or s.startswith('s'): + separator = s[1] + else: + separator = s[0] + if separator.isalnum() or separator in '{}[]()<>': + raise ValueError, \ + 'Invalid separator: separator must not be alphanumeric or in ' \ + '"{}[]()<>"' + return separator + +def _getSplitterRe(s): + separator = _getSep(s) + return re.compile(r'(?