Skip to content

Commit

Permalink
[foliaupgrade] convert datetime attribute; remove defaults after conv…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
proycon committed Mar 27, 2019
1 parent f19c7fe commit 58a72f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions foliatools/foliaupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ def annotators2processors(doc, mainprocessor):
else:
#Create a new processor
newprocessor = folia.Processor(element.annotator, type=annotatortype)
try:
newprocessor.begindatetime = doc.annotationdefaults[element.ANNOTATIONTYPE][element.set]['datetime']
except: #May likely not exist, that's ok
pass
mainprocessor.append(newprocessor)
element.setprocessor(newprocessor)
#delete the old style annotator
element.annotator = None
element.annotatortype = None
doc.annotationdefaults = {} #not needed anymore


def process(*files, **kwargs):
Expand Down

0 comments on commit 58a72f5

Please sign in to comment.