Skip to content

Commit 6e21661

Browse files
Resolve further merge bugs
1 parent 3fa2b5a commit 6e21661

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

app.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,7 @@ def upload_file(in_mmif):
148148
with open(path / 'file.mmif', 'w') as in_mmif_file:
149149
app.logger.debug(f"Writing original MMIF to {path / 'file.mmif'}")
150150
in_mmif_file.write(in_mmif_str)
151-
mmif = Mmif(in_mmif_str)
152-
htmlized_docs = utils.documents_to_htmls(mmif, viz_id)
153-
app.logger.debug(f"Prepared document: {[d[0] for d in htmlized_docs]}")
154-
annotations = utils.prep_annotations(mmif, viz_id)
155-
app.logger.debug(f"Prepared Annotations: {[annotation[0] for annotation in annotations]}")
156-
html_page = render_template('player.html',
157-
docs=htmlized_docs, viz_id=viz_id, annotations=annotations)
151+
html_page = render_mmif(in_mmif_str, viz_id)
158152
with open(os.path.join(path, "index.html"), "w") as f:
159153
f.write(html_page)
160154
except FileExistsError:
@@ -164,7 +158,6 @@ def upload_file(in_mmif):
164158
t = Thread(target=cleanup)
165159
t.daemon = True
166160
t.run()
167-
168161
agent = request.headers.get('User-Agent')
169162
if 'curl' in agent.lower():
170163
return f"Visualization ID is {viz_id}\nYou can access the visualized file at {request.url_root}display/{viz_id}\n"

ocr.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import re
66
import os
77
import shutil
8+
from mmif.vocabulary.annotation_types import AnnotationTypes
9+
from mmif.vocabulary.document_types import DocumentTypes
810

911
from mmif.utils.video_document_helper import convert_timepoint, convert_timeframe
1012

@@ -54,9 +56,8 @@ def update(self, anno, mmif):
5456

5557
def add_bounding_box(self, anno, mmif):
5658
if "timePoint" in anno.properties:
57-
timepoint_anno = find_annotation(
58-
anno.properties["timePoint"], mmif)
59-
59+
timepoint_anno = mmif[anno.get("timePoint")]
60+
6061
if timepoint_anno:
6162
self.add_timepoint(timepoint_anno, mmif,
6263
skip_if_view_has_frames=False)

utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def url2posix(path):
1111
return path
1212

1313

14-
def get_status(view):
14+
def get_status(view):
1515
return 'ERROR' if 'message' in view.metadata.error else 'OKAY'
1616

1717

0 commit comments

Comments
 (0)