Fix NTBP detection.

Fixes #25.
This commit is contained in:
D. Berge
2020-09-08 18:36:30 +02:00
parent 3c4ed6665c
commit 351d2a474b
2 changed files with 34 additions and 4 deletions

View File

@@ -51,6 +51,11 @@ if __name__ == '__main__':
filepath = str(filepath)
print(f"Found {filepath}")
if ntbpRx:
ntbp = ntbpRx.search(filepath) is not None
else:
ntbp = False
if not db.file_in_db(filepath):
print("Importing")
@@ -62,10 +67,6 @@ if __name__ == '__main__':
continue
file_info = dict(zip(pattern["captures"], match.groups()))
if ntbpRx:
ntbp = ntbpRx.match(filepath) is not None
else:
ntbp = False
p111_data = p111.from_file(filepath)
@@ -77,5 +78,11 @@ if __name__ == '__main__':
else:
print("Already in DB")
# Update the NTBP status to whatever the latest is,
# as it might have changed.
db.set_ntbp(filepath, ntbp)
if ntbp:
print("Sequence is NTBP")
print("Done")