On Mon, Nov 25, 2013 at 7:47 PM, John Chilton <chilton@msi.umn.edu> wrote:
On Mon, Nov 25, 2013 at 11:59 AM, Peter Cock <p.j.a.cock@googlemail.com> wrote:
Hello all,
I would like to modify the default ZIP bundle behaviour for composite datatypes, which currently insists on creating an HTML "main" file. To do this I think the current monolithic _archive_composite_dataset function needs to be refactored in file lib/galaxy/datatypes/data.py
I would like to move the section which currently names and populates the HTML index file into a sub-method, i.e. this chunk:
path = data.file_name fname = os.path.split(path)[-1] efp = data.extra_files_path htmlname = os.path.splitext(outfname)[0] if not htmlname.endswith(ext): htmlname = '%s_%s' % (htmlname,ext) archname = '%s.html' % htmlname # fake the real nature of the html file try: archive.add(data.file_name,archname) except IOError: error = True log.exception( "Unable to add composite parent %s to temporary library download archive" % data.file_name) msg = "Unable to create archive for download, please report this error"
Then by overriding this new method a subclass (custom composite datatype) could for example set the filename used inside the archive to be "index.html" or "index.htm" or anything else like "README.txt" (doesn't have to be HTML); alter the contents of the index file; or even not include an index file in the archive.
Would a pull request to do this be considered?
Hey Peter,
Definitely. This sounds like a great change - I am looking forward to merging it!
-John
I'll give that a go then, thanks. Peter