pep8 blank lines fixes
flake8 --select W391,E302,E301,E304 autopep8 can't fix W391 even though it claims it can. Fixed using a simple custom script.
This commit is contained in:
parent
be2c8bd789
commit
448c06d125
142 changed files with 249 additions and 25 deletions
|
|
@ -50,6 +50,7 @@ ESCAPE_MAPPINGS = {
|
|||
"Z": None,
|
||||
}
|
||||
|
||||
|
||||
class Choice(list):
|
||||
"""
|
||||
Used to represent multiple possibilities at this point in a pattern string.
|
||||
|
|
@ -57,16 +58,19 @@ class Choice(list):
|
|||
code is clear.
|
||||
"""
|
||||
|
||||
|
||||
class Group(list):
|
||||
"""
|
||||
Used to represent a capturing group in the pattern string.
|
||||
"""
|
||||
|
||||
|
||||
class NonCapture(list):
|
||||
"""
|
||||
Used to represent a non-capturing group in the pattern string.
|
||||
"""
|
||||
|
||||
|
||||
def normalize(pattern):
|
||||
"""
|
||||
Given a reg-exp pattern, normalizes it to a list of forms that suffice for
|
||||
|
|
@ -222,6 +226,7 @@ def normalize(pattern):
|
|||
|
||||
return zip(*flatten_result(result))
|
||||
|
||||
|
||||
def next_char(input_iter):
|
||||
"""
|
||||
An iterator that yields the next character from "pattern_iter", respecting
|
||||
|
|
@ -242,6 +247,7 @@ def next_char(input_iter):
|
|||
continue
|
||||
yield representative, True
|
||||
|
||||
|
||||
def walk_to_end(ch, input_iter):
|
||||
"""
|
||||
The iterator is currently inside a capturing group. We want to walk to the
|
||||
|
|
@ -262,6 +268,7 @@ def walk_to_end(ch, input_iter):
|
|||
return
|
||||
nesting -= 1
|
||||
|
||||
|
||||
def get_quantifier(ch, input_iter):
|
||||
"""
|
||||
Parse a quantifier from the input, where "ch" is the first character in the
|
||||
|
|
@ -298,6 +305,7 @@ def get_quantifier(ch, input_iter):
|
|||
ch = None
|
||||
return int(values[0]), ch
|
||||
|
||||
|
||||
def contains(source, inst):
|
||||
"""
|
||||
Returns True if the "source" contains an instance of "inst". False,
|
||||
|
|
@ -311,6 +319,7 @@ def contains(source, inst):
|
|||
return True
|
||||
return False
|
||||
|
||||
|
||||
def flatten_result(source):
|
||||
"""
|
||||
Turns the given source sequence into a list of reg-exp possibilities and
|
||||
|
|
@ -363,4 +372,3 @@ def flatten_result(source):
|
|||
for i in range(len(result)):
|
||||
result[i] += piece
|
||||
return result, result_args
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue