fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
assign ids over chunks
[librarian.git]
/
src
/
librarian
/
meta
/
types
/
date.py
diff --git
a/src/librarian/meta/types/date.py
b/src/librarian/meta/types/date.py
index
dcadef5
..
7094fc3
100644
(file)
--- a/
src/librarian/meta/types/date.py
+++ b/
src/librarian/meta/types/date.py
@@
-1,3
+1,6
@@
+from datetime import date
+import re
+import time
from .base import MetaValue
from .base import MetaValue
@@
-18,13
+21,10
@@
class DateValue(MetaValue):
"""
try:
# check out the "N. poł X w." syntax
"""
try:
# check out the "N. poł X w." syntax
- if isinstance(text, six.binary_type):
- text = text.decode("utf-8")
-
century_format = (
century_format = (
-
u
"(?:([12]) *poł[.]? +)?([MCDXVI]+) *w[.,]*(?: *l[.]? *([0-9]+))?"
+ "(?:([12]) *poł[.]? +)?([MCDXVI]+) *w[.,]*(?: *l[.]? *([0-9]+))?"
)
)
- vague_format =
u
"(?:po *|ok. *)?([0-9]{4})(-[0-9]{2}-[0-9]{2})?"
+ vague_format = "(?:po *|ok. *)?([0-9]{4})(-[0-9]{2}-[0-9]{2})?"
m = re.match(century_format, text)
m2 = re.match(vague_format, text)
m = re.match(century_format, text)
m2 = re.match(vague_format, text)