diff json2iframe.py @ 15:1cab73e6bf13 draft

"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 7f742b16e6e4c33b9abdb633405298e05760c84b"
author gga
date Tue, 08 Jun 2021 09:14:10 +0000
parents f26ac3b582e1
children
line wrap: on
line diff
--- a/json2iframe.py	Wed Aug 19 06:57:08 2020 -0400
+++ b/json2iframe.py	Tue Jun 08 09:14:10 2021 +0000
@@ -22,7 +22,7 @@
         <html>
             <head>
                 <title>Embedded Apollo Access</title>
-                <style type="text/css">body {{margin: 0;}} iframe {{border: 0;width: 100%;height: 100%}}</style>
+                <style type="text/css">body {{margin: 0;}} iframe {{border: 0;width: 100%;height: 100vh}}</style>
             </head>
             <body>
                 <iframe src="{base_url}/annotator/loadLink?loc={chrom}&organism={orgId}{tracklist}"></iframe>
@@ -30,4 +30,7 @@
         </html>
     """
 
-    print(HTML_TPL.format(base_url=args.external_apollo_url, chrom="", orgId=data[0]['id'], tracklist='&tracklist=1' if args.tracklist else ''))
+    if isinstance(data, list):
+        print(HTML_TPL.format(base_url=args.external_apollo_url, chrom="", orgId=data[0]['id'], tracklist='&tracklist=1' if args.tracklist else ''))
+    else:
+        print(HTML_TPL.format(base_url=args.external_apollo_url, chrom="", orgId=data['id'], tracklist='&tracklist=1' if args.tracklist else ''))