FIX: Caps and pytest (#482)

* FIX: Caps and pytest

* FIX: Check in code

* FIX: Check for unique names

* FIX: Minor fixes

* FIX: More checks
This commit is contained in:
Eric Larson
2018-05-07 13:27:48 -04:00
committed by GitHub
parent 90fcc8f635
commit 50bcf82833
7 changed files with 161 additions and 123 deletions

View File

@ -304,6 +304,10 @@ def build_dict(filename):
with codecs.open(filename, mode='r', buffering=1, encoding='utf-8') as f:
for line in f:
[key, data] = line.split('->')
# TODO for now, convert both to lower. Someday we can maybe add
# support for fixing caps.
key = key.lower()
data = data.lower()
if key in ignore_words:
continue
data = data.strip()
@ -588,7 +592,7 @@ def main(*args):
dictionaries = options.dictionary or [default_dictionary]
for dictionary in dictionaries:
if dictionary is "-":
if dictionary == "-":
dictionary = default_dictionary
if not os.path.exists(dictionary):
print('ERROR: cannot find dictionary file: %s' % dictionary,