Skip to content

Commit 63ac8ac

Browse files
author
Robyn Speer
committed
flake8 fixes
1 parent c1a9fc5 commit 63ac8ac

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

ftfy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def fix_text(text,
185185

186186
return ''.join(out)
187187

188+
188189
# Some alternate names for the main functions
189190
ftfy = fix_text
190191
fix_encoding = fixes.fix_encoding

ftfy/bad_codecs/sloppy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class StreamReader(Codec, codecs.StreamReader):
149149
streamwriter=StreamWriter,
150150
)
151151

152+
152153
# Define a codec for each incomplete encoding. The resulting CODECS dictionary
153154
# can be used by the main module of ftfy.bad_codecs.
154155
CODECS = {}

ftfy/badness.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def _make_weirdness_regex():
9191
regex = '|'.join(groups)
9292
return re.compile(regex)
9393

94+
9495
WEIRDNESS_RE = _make_weirdness_regex()
9596

9697
# These characters appear in mojibake but also appear commonly on their own.
@@ -152,6 +153,7 @@ def _make_weirdness_regex():
152153
'вЂ[љћ¦°№™ќ“”]'
153154
)
154155

156+
155157
def sequence_weirdness(text):
156158
"""
157159
Determine how often a text has unexpected characters or sequences of

ftfy/build_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,6 @@ def make_char_data_file(do_it_anyway=False):
125125
out.write(zlib.compress(''.join(cclasses).encode('ascii')))
126126
out.close()
127127

128+
128129
if __name__ == '__main__':
129130
make_char_data_file()

ftfy/chardata.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def _build_regexes():
4747
regex = '^[\x00-\x19\x1b-\x7f{0}]*$'.format(charlist)
4848
encoding_regexes[encoding] = re.compile(regex)
4949
return encoding_regexes
50+
51+
5052
ENCODING_REGEXES = _build_regexes()
5153

5254

@@ -68,6 +70,8 @@ def _build_utf8_punct_regex():
6870
+ bytes(range(0x80, 0xa0)).decode('sloppy-windows-1252')
6971
+ ']')
7072
return re.compile(obvious_utf8)
73+
74+
7175
PARTIAL_UTF8_PUNCT_RE = _build_utf8_punct_regex()
7276

7377

@@ -173,6 +177,8 @@ def _build_control_char_mapping():
173177
control_chars[i] = None
174178

175179
return control_chars
180+
181+
176182
CONTROL_CHARS = _build_control_char_mapping()
177183

178184

@@ -228,4 +234,6 @@ def _build_width_map():
228234
if alternate != char:
229235
width_map[i] = alternate
230236
return width_map
237+
238+
231239
WIDTH_MAP = _build_width_map()

ftfy/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
Can't read and write the same file. Please output to a new file instead.
3939
"""
4040

41+
4142
def main():
4243
"""
4344
Run ftfy as a command-line utility.

0 commit comments

Comments
 (0)