# HG changeset patch # User Jan Kanis # Date 1400165169 -7200 # Node ID 4e6ac737ba179d996a690a8a7e5c6a1705156aca # Parent eee23a36c582663cc45e000f3d98a772720d5351 improve the galaxy html stripping warning; make sure the tool can find the template from within galaxy diff -r eee23a36c582 -r 4e6ac737ba17 blast2html.html.jinja --- a/blast2html.html.jinja Thu May 15 12:44:44 2014 +0200 +++ b/blast2html.html.jinja Thu May 15 16:46:09 2014 +0200 @@ -371,8 +371,16 @@ -
- This html seems to have been stripped by Galaxy. Disable Galaxy's html sanitization feature to view the full page, or download this page instead of viewing it in Galaxy. + +
+ +
+
This html page seems to have been stripped by Galaxy.
+ Disable Galaxy's html sanitization feature to view the full page (see sanitize_all_html in your galaxy's universe_wsgi.ini), or download this page instead of viewing it in Galaxy. +
diff -r eee23a36c582 -r 4e6ac737ba17 blast2html.py --- a/blast2html.py Thu May 15 12:44:44 2014 +0200 +++ b/blast2html.py Thu May 15 16:46:09 2014 +0200 @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# Actually runs under either python 2 or 3 # Copyright The Hyve B.V. 2014 # License: GPL version 3 or higher @@ -273,8 +274,10 @@ ident = "{:.0%}".format(float(min(hsp.Hsp_identity / blastxml_len(hsp) for hsp in hsps))), accession = hit.Hit_accession) + def main(): - + default_template = path.join(path.dirname(__file__), 'blast2html.html.jinja') + parser = argparse.ArgumentParser(description="Convert a BLAST XML result into a nicely readable html page", usage="{} [-i] INPUT [-o OUTPUT]".format(sys.argv[0])) input_group = parser.add_mutually_exclusive_group(required=True) @@ -289,7 +292,7 @@ # handle the errors. This introduces a small race condition when # jinja later tries to re-open the template file, but we don't # care too much. - parser.add_argument('--template', type=argparse.FileType(mode='r'), default='blast2html.html.jinja', + parser.add_argument('--template', type=argparse.FileType(mode='r'), default=default_template, help='The template file to use. Defaults to blast_html.html.jinja') args = parser.parse_args()