Show More
@@ -131,7 +131,8 b' pypats = [' | |||||
131 | (r'[^\n]\Z', "no trailing newline"), |
|
131 | (r'[^\n]\Z', "no trailing newline"), | |
132 | (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), |
|
132 | (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), | |
133 | # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"), |
|
133 | # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"), | |
134 | # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), |
|
134 | (r'^\s+(self\.)?[A-za-z][a-z0-9]+[A-Z]\w* = ', | |
|
135 | "don't use camelcase in identifiers"), | |||
135 | (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', |
|
136 | (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', | |
136 | "linebreak after :"), |
|
137 | "linebreak after :"), | |
137 | (r'class\s[^( \n]+:', "old-style class, use class foo(object)"), |
|
138 | (r'class\s[^( \n]+:', "old-style class, use class foo(object)"), |
@@ -24,7 +24,7 b' except ImportError:' | |||||
24 | try: |
|
24 | try: | |
25 | from elementtree.ElementTree import ElementTree, XMLParser |
|
25 | from elementtree.ElementTree import ElementTree, XMLParser | |
26 | except ImportError: |
|
26 | except ImportError: | |
27 | ElementTree = None |
|
27 | pass | |
28 |
|
28 | |||
29 | class darcs_source(converter_source, commandline): |
|
29 | class darcs_source(converter_source, commandline): | |
30 | def __init__(self, ui, path, rev=None): |
|
30 | def __init__(self, ui, path, rev=None): | |
@@ -42,7 +42,7 b' class darcs_source(converter_source, com' | |||||
42 | raise util.Abort(_('darcs version 2.1 or newer needed (found %r)') % |
|
42 | raise util.Abort(_('darcs version 2.1 or newer needed (found %r)') % | |
43 | version) |
|
43 | version) | |
44 |
|
44 | |||
45 |
if ElementTree |
|
45 | if "ElementTree" not in globals(): | |
46 | raise util.Abort(_("Python ElementTree module is not available")) |
|
46 | raise util.Abort(_("Python ElementTree module is not available")) | |
47 |
|
47 | |||
48 | self.path = os.path.realpath(path) |
|
48 | self.path = os.path.realpath(path) |
General Comments 0
You need to be logged in to leave comments.
Login now