Skip to content

Commit 2868045

Browse files
authored
Merge pull request #10 from dave3d/Flake8Fixes
Fixes for flake8
2 parents 5574cd7 + 85893e5 commit 2868045

4 files changed

Lines changed: 20 additions & 18 deletions

File tree

codespell.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def parse_args():
171171
dest='prefixes',
172172
help='Add word prefix (multiples allowed)')
173173

174-
175174
parser.add_argument('--miss', '-m', action='store_true', default=False,
176175
dest='miss', help='Only output the misspelt words')
177176

utils/itkcrawl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
wrds = dir(itk)
66

7-
result= []
7+
result = []
88

99
for w in wrds:
10-
x = getattr(itk,w)
10+
x = getattr(itk, w)
1111
for y in dir(x):
1212
if "_" in y:
1313
continue
@@ -17,5 +17,5 @@
1717
result2 = sorted(set(result))
1818

1919
for w in result2:
20-
if len(w)>2:
20+
if len(w) > 2:
2121
print(w)

utils/myspell.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
#! /usr/bin/env python
22

3-
import os
3+
import sys
44
from enchant.checker import SpellChecker
5-
from enchant.tokenize import Filter, EmailFilter, URLFilter
5+
from enchant.tokenize import EmailFilter, URLFilter
66
from enchant import DictWithPWL
77

88

99
def myspell(fname):
1010
my_dict = DictWithPWL('en_US', 'mywords.txt')
1111
print(my_dict)
1212

13-
spell_checker = SpellChecker(my_dict, filters = [EmailFilter, URLFilter])
13+
spell_checker = SpellChecker(my_dict, filters=[EmailFilter, URLFilter])
1414

1515
fp = open(fname, 'r')
1616

1717
lc = 1
1818
for x in fp:
19-
spell_checker.set_text(x)
20-
for error in spell_checker:
21-
print("Error:", error.word, "(line", lc, ")")
22-
lc = lc+1
23-
24-
25-
#myspell('/Users/dchen/SimpleITK/Documentation/docs/source/faq.rst')
26-
myspell('/Users/dchen/SimpleITK/Code/Common/include/sitkImage.h')
27-
19+
spell_checker.set_text(x)
20+
for error in spell_checker:
21+
print("Error:", error.word, "(line", lc, ")", file=sys.stderr)
22+
lc = lc+1
23+
24+
25+
if __name__ == '__main__':
26+
if len(sys.argv) > 1:
27+
for x in sys.argv[1:]:
28+
myspell(x)
29+
else:
30+
print("Usage: myspell.py file1 ... fileN")

utils/sitkcrawl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
wrds = dir(sitk)
66

7-
result= []
7+
result = []
88

99
for w in wrds:
10-
x = getattr(sitk,w)
10+
x = getattr(sitk, w)
1111
for y in dir(x):
1212
if "_" in y:
1313
continue

0 commit comments

Comments
 (0)