fix vcf filter and tweak test_imports for better pythonic
This commit is contained in:
parent
a8fe152a43
commit
3bcfdcff60
@ -148,7 +148,16 @@ def vcffilt(line):
|
|||||||
The differences are not functional, but are related to changes in Gramps
|
The differences are not functional, but are related to changes in Gramps
|
||||||
version.
|
version.
|
||||||
"""
|
"""
|
||||||
return False if line.startswith('PRODID:') else True
|
diftyp = line[0]
|
||||||
|
if diftyp == '@':
|
||||||
|
retval = False
|
||||||
|
elif diftyp == ' ':
|
||||||
|
retval = False
|
||||||
|
elif 'PRODID:' in line: # Gramps version is on these lines
|
||||||
|
retval = False
|
||||||
|
else:
|
||||||
|
retval = True
|
||||||
|
return retval
|
||||||
|
|
||||||
|
|
||||||
class ExportControl(unittest.TestCase):
|
class ExportControl(unittest.TestCase):
|
||||||
|
@ -243,7 +243,7 @@ else:
|
|||||||
_tstfiles = []
|
_tstfiles = []
|
||||||
for _tstfile in os.listdir(TEST_DIR):
|
for _tstfile in os.listdir(TEST_DIR):
|
||||||
(fname, ext) = os.path.splitext(os.path.basename(_tstfile))
|
(fname, ext) = os.path.splitext(os.path.basename(_tstfile))
|
||||||
if ext == ".gramps" or ext == ".difs" or ext == ".bak" \
|
if ext in (".gramps", ".difs", ".bak") \
|
||||||
or not fname.startswith("imp_"):
|
or not fname.startswith("imp_"):
|
||||||
continue
|
continue
|
||||||
test_func = make_tst_function(_tstfile, fname)
|
test_func = make_tst_function(_tstfile, fname)
|
||||||
|
Loading…
Reference in New Issue
Block a user