On Thu, Nov 7, 2013 at 12:21 PM, Peter Cock <p.j.a.c...@googlemail.com> wrote:
>
> Related to this, would people prefer if the $on_string in the case of
> a single input file was the input file's name (e.g. "My Genes") rather
> than "data 1"? (When there are multiple input files, $on_string needs
> to be kept short).

That turned out to be quite an easy change (patch below), and
personally I think this makes the $on_string much nicer.

Peter

--

$ hg diff lib/galaxy/tools/actions/__init__.py
diff -r 77d58fdd1c2e lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py    Tue Oct 29 14:21:48 2013 -0400
+++ b/lib/galaxy/tools/actions/__init__.py    Thu Nov 07 15:15:42 2013 +0000
@@ -181,6 +181,7 @@
         input_names = []
         input_ext = 'data'
         input_dbkey = incoming.get( "dbkey", "?" )
+        on_text = ''
         for name, data in inp_data.items():
             if not data:
                 data = NoneDataset( datatypes_registry =
trans.app.datatypes_registry )
@@ -194,6 +195,7 @@
             else: # HDA
                 if data.hid:
                     input_names.append( 'data %s' % data.hid )
+                    on_text = data.name # Will use below if only one
input dataset
             input_ext = data.ext

             if data.dbkey not in [None, '?']:
@@ -230,7 +232,10 @@
             output_permissions =
trans.app.security_agent.history_get_default_permissions( history )
         # Build name for output datasets based on tool name and input names
         if len( input_names ) == 1:
-            on_text = input_names[0]
+            #We recorded the dataset name as on_text earlier...
+            if not on_text:
+                #Fall back on the shorter 'data %i' style:
+                on_text = input_names[0]
         elif len( input_names ) == 2:
             on_text = '%s and %s' % tuple(input_names[0:2])
         elif len( input_names ) == 3:
___________________________________________________________
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Reply via email to