It went into galaxy-central:

$ hg log -pr 5082
changeset:   5082:a86e1fa82a89
user:        Kanwei Li <kan...@gmail.com>
date:        Thu Feb 17 15:35:07 2011 -0500
summary:     Add a "format_source" attribute to the ToolConfig output data 
element [JJ Johnson]. Closes #470

diff -r 885f04ae671e -r a86e1fa82a89 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py      Thu Feb 17 14:48:53 2011 -0500
+++ b/lib/galaxy/tools/__init__.py      Thu Feb 17 15:35:07 2011 -0500
@@ -249,10 +249,11 @@
       (format, metadata_source, parent)
     """

-    def __init__( self, name, format=None, metadata_source=None,
+    def __init__( self, name, format=None, format_source=None, 
metadata_source=None,
                   parent=None, label=None, filters = None, actions = None ):
         self.name = name
         self.format = format
+        self.format_source = format_source
         self.metadata_source = metadata_source
         self.parent = parent
         self.label = label
@@ -559,6 +560,7 @@
             output = ToolOutput( data_elem.get("name") )
             output.format = data_elem.get("format", "data")
             output.change_format = data_elem.findall("change_format")
+            output.format_source = data_elem.get("format_source", None)
             output.metadata_source = data_elem.get("metadata_source", "")
             output.parent = data_elem.get("parent", None)
             output.label = util.xml_text( data_elem, "label" )
diff -r 885f04ae671e -r a86e1fa82a89 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py      Thu Feb 17 14:48:53 2011 -0500
+++ b/lib/galaxy/tools/actions/__init__.py      Thu Feb 17 15:35:07 2011 -0500
@@ -244,6 +244,12 @@
                     ext = output.format
                     if ext == "input":
                         ext = input_ext
+                    if output.format_source is not None and 
output.format_source in inp_data:
+                        try:
+                            ext = inp_data[output.format_source].ext
+                        except Exception, e:
+                            pass
+
                     #process change_format tags
                     if output.change_format:
                         if params is None:



And I should have put an example in:   
https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax



On 6/8/11 3:32 PM, Peter Cock wrote:
On Wed, Jun 8, 2011 at 9:26 PM, Jim Johnson<johns...@umn.edu>  wrote:
I added an attribute "format_source"  (analogous to metadata_source)
  to the<data>  tag to deal with that kind of issue:
see:   https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax

Where is the code to handle this? Maybe I missed the commit
with all the recent activity.

What happens if both format and format_source are given? I
would hope an error - which means the wiki is misleading in
that format is listed as required.

Peter

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/

Reply via email to