# HG changeset patch
# User trinity_ctat
# Date 1525183138 14400
# Node ID 4fa8238660cc4362b67102df993be9e8c64c743f
# Parent 772b977ac9a1683b9b3c3a164aa8751e9ca44989
Uploaded
diff -r 772b977ac9a1 -r 4fa8238660cc data_manager/add_ctat_centrifuge_index.py
--- a/data_manager/add_ctat_centrifuge_index.py Mon Apr 30 08:46:43 2018 -0400
+++ b/data_manager/add_ctat_centrifuge_index.py Tue May 01 09:58:58 2018 -0400
@@ -63,38 +63,36 @@
# End of class FileListParser
def get_ctat_centrifuge_index_locations():
+ # For dynamic options need to return an interable with contents that are tuples with 3 items.
+ # Item one is a string that is the display name put into the option list.
+ # Item two is the value that is put into the parameter associated with the option list.
+ # Item three is a True or False value, indicating whether the item is selected.
+ options = []
# open the url and retrieve the filenames of the files in the directory.
resource = urllib2.urlopen(_CTAT_CentrifugeIndexPage_URL)
theHTML = resource.read()
filelist_parser = FileListParser()
filelist_parser.feed(theHTML)
- # return a tuple of the filenames
- # return tuple(filelist_parser.filenames)
- # For now, I am printing the list, just so I can see what was returned,
# This is what was returned on 2018-04-23
# ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed_2018_4_15.tar.gz
# ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/nt_2018_3_3.tar.gz
# ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed+h+v.tar.gz
# ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p+h+v.tar.gz
+ # Which could be hard coded:
+ # options.append(("p_compressed+h+v", "ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed+h+v.tar.gz", True))
+ # options.append(("p+h+v", "ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p+h+v.tar.gz", False))
+ # options.append(("nt_2018_3_3", "ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/nt_2018_3_3.tar.gz", False))
+ # options.append(("p_compressed_2018_4_15", "ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed_2018_4_15.tar.gz", False))
# but only returning the one we want, which for now is assumed to be present.
+ # For now, I am printing the list, just so I can see what was returned,
print "FYI: The URL's that were found on Centrifuge's page are:"
print "\t" + "\n\t".join(filelist_parser.filenames)
- # Instead of sending back the list of found URL's, send back the one URL we want.
- # vals.add(_CTAT_CentrifugeDownload_URL)
- # FIX - we have been unable to figure out what the format is that we need to send back.
- # I have tried various things. It seems to need something two layered, that is,
- # a tuple or a dict of something that can be sequenced over using next.
- # return tuple(filelist_parser.filenames) # this is what I originally had, but it doesn't work.
- # return ("one","two") # only prints 'o' and 't'.
- #vals=set()
- #vals.add("one")
- #vals.add("two")
- # vals = ("one", "onemore", "/path/to/one")
- vals = [dict(name="one", value="onemore", path="/path/to/one")]
+ # For now instead of sending back the list of found URL's, send back the one URL we want.
+ # Currently, only one of the options is supported.
+ options.append((_CTAT_CentrifugeDir_Name, _CTAT_CentrifugeDownload_URL, True))
print "The items in vals are:"
- print str(vals)
- return vals # works kind of, but nothing is printed in the pull down list.
- # return tuple(vals)
+ print str(options)
+ return options
# The following was used by the example program to get input parameters through the json.
# Just leaving here for reference.
diff -r 772b977ac9a1 -r 4fa8238660cc data_manager/add_ctat_centrifuge_index.xml
--- a/data_manager/add_ctat_centrifuge_index.xml Mon Apr 30 08:46:43 2018 -0400
+++ b/data_manager/add_ctat_centrifuge_index.xml Tue May 01 09:58:58 2018 -0400
@@ -43,13 +43,18 @@
However, I have not been able to figure out how to send information back correctly
from the function and there is no documentation that I have found showing how to do it.
- -->
+ dynamic_options="get_ctat_centrifuge_index_locations()"
+ help="Select a Centrifuge Index to Download." />
+ Hard coded version.
+ -->
+