Creating workflow which includes Multifile upload

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating workflow which includes Multifile upload

alexbk66

Hi John,

 

One more problem with multifile upload – when I display a workflow which includes multi upload tool, I get:

 

Module workflow_run_mako:476 in render_row_for_param
>>  __M_writer(unicode(param.get_label()))
AttributeError: 'UploadDataset' object has no attribute 'get_label'

 

Ok, I see that UploadDataset class is derived from Group, not ToolParameter. So I tried to add get_label() to the Group class, which returns some string.  But then I get:

 

Module workflow_run_mako:476 in render_row_for_param
>>  __M_writer(unicode(param.get_label()))
TypeError: 'str' object is not callable

 

Here my knowledge of Galaxy ends and I need some help please.

 

-Alex


___________________________________________________________
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 | Threaded
Open this post in threaded view
|

Re: Creating workflow which includes Multifile upload

Peter Cock
On Wed, Jun 5, 2013 at 8:56 AM,  <[hidden email]> wrote:

> Hi John,
>
> One more problem with multifile upload – when I display a workflow which
> includes multi upload tool, I get:
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> AttributeError: 'UploadDataset' object has no attribute 'get_label'
>
> Ok, I see that UploadDataset class is derived from Group, not ToolParameter.
> So I tried to add get_label() to the Group class, which returns some string.
> But then I get:
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> TypeError: 'str' object is not callable
>
> Here my knowledge of Galaxy ends and I need some help please.

Hi Alex,

I guess from the Python exception that you didn't create a method
called get_label, but a property or attribute perhaps? Try this at the
python prompt and you'll get the same TypeError:

>>> "hello"()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

I would have added a get_label method to the class using something
like this:

class UploadDataset(...):
    ....
    def get_label(self):
       return "Uploaded stuff"

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Creating workflow which includes Multifile upload

alexbk66
Hi Peter,

Of course I added def get_label(self), as a matter of fact, I copied get_label() from ToolParameter class. That's why I'm a bit confused.  

The get_label function returns a string which is supposed to be displayed, but instead something is trying to execute it?

Best Regards,

Alex Khassapov

Software Engineer
CSIRO IM&T
________________________________________
From: Peter Cock [[hidden email]]
Sent: Wednesday, 5 June 2013 7:36 PM
To: Khassapov, Alex (CSIRO IM&T, Clayton)
Cc: [hidden email]; [hidden email]; NeCTAR Cloud Imaging Project Team
Subject: Re: [galaxy-dev] Creating workflow which includes Multifile upload

On Wed, Jun 5, 2013 at 8:56 AM,  <[hidden email]> wrote:

> Hi John,
>
> One more problem with multifile upload – when I display a workflow which
> includes multi upload tool, I get:
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> AttributeError: 'UploadDataset' object has no attribute 'get_label'
>
> Ok, I see that UploadDataset class is derived from Group, not ToolParameter.
> So I tried to add get_label() to the Group class, which returns some string.
> But then I get:
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> TypeError: 'str' object is not callable
>
> Here my knowledge of Galaxy ends and I need some help please.

Hi Alex,

I guess from the Python exception that you didn't create a method
called get_label, but a property or attribute perhaps? Try this at the
python prompt and you'll get the same TypeError:

>>> "hello"()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

I would have added a get_label method to the class using something
like this:

class UploadDataset(...):
    ....
    def get_label(self):
       return "Uploaded stuff"

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Creating workflow which includes Multifile upload

Peter Cock
On Wed, Jun 5, 2013 at 12:21 PM,  <[hidden email]> wrote:
> Hi Peter,
>
> Of course I added def get_label(self), as a matter of fact, I copied get_label() from ToolParameter class. That's why I'm a bit confused.
>
> The get_label function returns a string which is supposed to be displayed, but instead something is trying to execute it?
>
> Best Regards,
>
> Alex Khassapov

That rules out the simple answer then, that's a shame :(

Is your change on bitbucket, or could you post a diff, which might
help others in reproducing the problem?

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Creating workflow which includes Multifile upload

John Chilton
In reply to this post by alexbk66
If you don't have pull request 122 in your code base, you will want to add it:

https://bitbucket.org/galaxy/galaxy-central/pull-request/122/add-optional-upload-attribute-to-tool/diff

Then, all you need to do is add the attribute '
workflow_compatible="false" ' to your top level tool XML element in
multi_upload.xml.

See most updated version as demonstration:
https://bitbucket.org/msiappdev/galaxy-extras/src/904fcbe55c7cd16a80f310bfd5c18c8d1d43cc04/tools/data_source/multi_upload.xml?at=stable

-John

On Wed, Jun 5, 2013 at 2:56 AM,  <[hidden email]> wrote:

> Hi John,
>
>
>
> One more problem with multifile upload – when I display a workflow which
> includes multi upload tool, I get:
>
>
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> AttributeError: 'UploadDataset' object has no attribute 'get_label'
>
>
>
> Ok, I see that UploadDataset class is derived from Group, not ToolParameter.
> So I tried to add get_label() to the Group class, which returns some string.
> But then I get:
>
>
>
> Module workflow_run_mako:476 in render_row_for_param
>>>  __M_writer(unicode(param.get_label()))
> TypeError: 'str' object is not callable
>
>
>
> Here my knowledge of Galaxy ends and I need some help please.
>
>
>
> -Alex

___________________________________________________________
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/