Patch from Raphael Ackermann <raphael.ackermann@gmail.com> -- Fix 0001538: tabs and spaces are mixed in some source files

svn: r9713
This commit is contained in:
Brian Matherly
2008-01-05 20:10:26 +00:00
parent aa8288eddd
commit bf3900f043
57 changed files with 499 additions and 440 deletions

View File

@@ -207,14 +207,14 @@ class DateParser:
self.ymd = False
def re_longest_first(self, keys):
"""
returns a string for a RE group which contains the given keys
"""
returns a string for a RE group which contains the given keys
sorted so that longest keys match first. Any '.' characters
are quoted.
"""
keys.sort(lambda x, y: cmp(len(y), len(x)))
return '(' + '|'.join([key.replace('.', '\.') for key in keys]) + ')'
are quoted.
"""
keys.sort(lambda x, y: cmp(len(y), len(x)))
return '(' + '|'.join([key.replace('.', '\.') for key in keys]) + ')'
def init_strings(self):
"""
This method compiles regular expression strings for matching dates.
@@ -508,7 +508,7 @@ class DateParser:
match = self._bce_re.match(text)
bc = False
if match:
# bce is in the match.group(2)
# bce is in the match.group(2)
try:
text = match.group(1) + match.group(3)
except: