diff history_metadata_extractor.py @ 1:c7f4f2ac38f2 draft default tip

" master branch Updating"
author lain
date Tue, 09 Aug 2022 15:19:45 +0000
parents 426b0f85a311
children
line wrap: on
line diff
--- a/history_metadata_extractor.py	Tue Jul 19 07:36:57 2022 +0000
+++ b/history_metadata_extractor.py	Tue Aug 09 15:19:45 2022 +0000
@@ -9,25 +9,28 @@
 import sys
 
 
-with open(os.path.join(sys.path[0], "static", "app.css")) as css:
+STATIC = os.path.join(sys.path[0], "static")
+VENDOR = os.path.join(sys.path[0], "vendor")
+
+with open(os.path.join(STATIC, "app.css")) as css:
   CSS_STYLES = css.read()
 
-with open(os.path.join(sys.path[0], "vendor", "bootstrap.min.css")) as bootstrap:
+with open(os.path.join(VENDOR, "bootstrap.min.css")) as bootstrap:
   CSS_STYLES = f"{CSS_STYLES}\n{bootstrap.read()}"
 
-with open(os.path.join(sys.path[0], "static", "app.js")) as js:
+with open(os.path.join(STATIC, "app.js")) as js:
   JAVASCRIPT = js.read()
 
-with open(os.path.join(sys.path[0], "static", "app.template.html")) as template:
+with open(os.path.join(STATIC, "app.template.html")) as template:
   PAGE_TEMPLATE = template.read()
 
-with open(os.path.join(sys.path[0], "static", "title.template.html")) as template:
+with open(os.path.join(STATIC, "title.template.html")) as template:
   TITLE_TEMPLATE = template.read()
 
-with open(os.path.join(sys.path[0], "static", "table.template.html")) as template:
+with open(os.path.join(STATIC, "table.template.html")) as template:
   TABLE_TEMPLATE = template.read()
 
-with open(os.path.join(sys.path[0], "static", "header_list.template.html")) as template:
+with open(os.path.join(STATIC, "header_list.template.html")) as template:
   HEADER_LIST_TEMPLATE = template.read()
 
 HEADER_LIST_TEMPLATE = '\n'.join((
@@ -113,7 +116,6 @@
     classes = "alert alert-danger"
   if hid == "DELETED":
     classes += " history_metadata_extractor_deleted"
-  print(job_attr)
   tool_name = job_attr["tool_id"] or "unknown"
   if tool_name.count("/") >= 4:
     tool_name = job_attr["tool_id"].split("/")[-2]
@@ -122,7 +124,6 @@
   return TABLE_TEMPLATE.format(
     classes=classes,
     tool_name=tool_name,
-    tool_output="",
     tool_status=status,
     table=convert_parameters_to_html(job_attr)
   )
@@ -140,7 +141,6 @@
   ))
 
 def params_enrichment(job_attr, params):
-  print(params)
   if (
     all(map(params.__contains__, ("request_json", "files")))
     and "encoded_id" in job_attr