Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new date extraction rule #73 #74

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions acdh_cidoc_pyutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
final_start, final_end = end, end
elif when and not start and not end:
final_start, final_end = when, when
elif when and end and not start:
final_start, final_end = when, end

Check warning on line 74 in acdh_cidoc_pyutils/__init__.py

View check run for this annotation

Codecov / codecov/patch

acdh_cidoc_pyutils/__init__.py#L73-L74

Added lines #L73 - L74 were not covered by tests
else:
if start and end:
final_start, final_end = start, end
Expand All @@ -79,6 +81,8 @@
final_start, final_end = None, end
elif when and not start and not end:
final_start, final_end = when, when
elif when and end and not start:
final_start, final_end = when, end

Check warning on line 85 in acdh_cidoc_pyutils/__init__.py

View check run for this annotation

Codecov / codecov/patch

acdh_cidoc_pyutils/__init__.py#L85

Added line #L85 was not covered by tests
return final_start, final_end


Expand Down