# HG changeset patch # User Vimalkumar Velayudhan # Date 1435921169 -3600 # Node ID 6423c038695d195ef67e881c9002b63da1b3f78e First commit diff -r 000000000000 -r 6423c038695d html_export.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html_export.py Fri Jul 03 11:59:29 2015 +0100 @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +import os +import argparse + +parser = argparse.ArgumentParser( + description='Create a HTML output file with link to a sample text file') +parser.add_argument('--html_file', default='html_export.html') +parser.add_argument('--output_path', default=os.getcwd()) +args = parser.parse_args() + +html = """\ + + + + + HTML export + + +

HTML output file with link to sample text file

+

Download: {content}

+ + + +""" + +# create output directory +os.mkdir(args.output_path) + +# create the text file with content +with open(os.path.join(args.output_path, 'paths.txt'), 'w') as f: + paths = os.environ['PATH'].split(':') + f.write('\n'.join(paths)) + +# write html file +with open(args.html_file, 'w') as g: + g.write(html.format(content='paths.txt')) diff -r 000000000000 -r 6423c038695d html_export.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html_export.xml Fri Jul 03 11:59:29 2015 +0100 @@ -0,0 +1,23 @@ + + Create a HTML output file with link to a sample text file + + + + + html_export.py + --html_file "${html_file}" + --output_path "${html_file.files_path}" + + + + + +Test HTML export with included files +------------------------------------ +This is a simple tool to test HTML export with attachments as described in the +`wiki <https://wiki.galaxyproject.org/Admin/Tools/Multiple Output Files>`_ + +The output will be a HTML file with link to a sample text file. + + + \ No newline at end of file