Re: [galaxy-dev] Python ValueError: too many values to unpack

2016-10-18 Thread Peter Cock
I just found this old email by a very similar exception logged as:

https://github.com/galaxyproject/galaxy/issues/2987

There do seem to be some corner cases where missing default
values are not handled nicely.

Peter


On Tue, Jan 26, 2016 at 2:38 PM, Matthias De Smet
 wrote:
> Wow, great tip! This fixed it!
>
> Thanks a bunch!
> Matthias
>
>
>> Op 26 jan. 2016, om 15:20 heeft Hans-Rudolf Hotz  het volgende 
>> geschreven:
>>
>> Hi Matthias
>>
>>
>> Make sure 'listing' is a list of (displayName,value,boolean)
>>
>> Though, there might be other errors as well
>>
>>
>> Regards, Hans-Rudolf
>>
>> I am not sure, whether this
>> On 01/26/2016 01:22 PM, Matthias De Smet wrote:
>>> Hi all,
>>>
>>> I’m trying to develop a tool that lets you select a file on the server.
>>> I’m using the dynamic_options setting to let Galaxy render a dropdown
>>> list of available file.
>>>
>>>
>>> However, when I try to test the tool in its current form, I get the
>>> following error:
>>>
>>> 
>>> galaxy.web.framework.decorators ERROR 2016-01-26 13:08:35,649 Uncaught
>>> exception in exposed API method:
>>> Traceback (most recent call last):
>>>   File "lib/galaxy/web/framework/decorators.py", line 260, in decorator
>>> rval = func( self, trans, *args, **kwargs)
>>>   File "lib/galaxy/webapps/galaxy/api/tools.py", line 98, in build
>>> return tool.to_json(trans, kwd.get('inputs', kwd))
>>>   File "lib/galaxy/tools/__init__.py", line 2602, in to_json
>>> populate_state(trans, self.inputs, state_inputs, state_errors,
>>> params.__dict__)
>>>   File "lib/galaxy/tools/__init__.py", line 2471, in populate_state
>>> state[input.name] = input.get_initial_value(trans, context,
>>> history=history)
>>>   File "lib/galaxy/tools/parameters/basic.py", line 984, in
>>> get_initial_value
>>> value = [ optval for _, optval, selected in options if selected ]
>>> ValueError: too many values to unpack
>>> 
>>>
>>> My tool xml looks like this:
>>>
>>> 
>>>
>>> 
>>>   from the archive to a data library
>>>   
>>>   
>>> test.sh > $log
>>>   
>>>   
>>> >> label="Choose source archive">
>>>   
>>> 
>>> 
>>>   
>>> 
>>> 
>>> >> dynamic_options="list_files(archive_source,query)"/>
>>> 
>>>   
>>> 
>>>  
>>>   
>>> 
>>> 
>>>   
>>>   
>>> This tool copies data from and archive folder to your history. Keep in
>>> mind this folder MUST be readable by Galaxy in order for this tool to work.
>>>   
>>> 
>>>
>>> 
>>>
>>> and the script called in the “code” tag looks like this
>>>
>>> 
>>> def list_files(dir,query): listing=[]
>>> for fname in listdir(dir):
>>>  fullpath = path.join(dir, fname) #only select datafiles, not md5
>>> checksums
>>>  if path.isfile(fullpath) and not fullpath.endswith(".md5"):
>>>  listing.append( fname )
>>> return listing
>>> 
>>>
>>> This script should return a list with filenames that should be displayed
>>> in the dropdown list.
>>>
>>> I’m tracking Galaxy release 15.10, running on a Ubuntu 14.04.3 server
>>>
>>> Thanks for your help!
>>>
>>> Matthias
>>>
>>>
>>>
>>>
>>>
>>>
>>> ___
>>> 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:
>>>   https://lists.galaxyproject.org/
>>>
>>> To search Galaxy mailing lists use the unified search at:
>>>   http://galaxyproject.org/search/mailinglists/
>>>
>
> ___
> 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:
>   https://lists.galaxyproject.org/
>
> To search Galaxy mailing lists use the unified search at:
>   http://galaxyproject.org/search/mailinglists/
___
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:
  https://lists.galaxyproject.org/

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

Re: [galaxy-dev] Python ValueError: too many values to unpack

2016-01-26 Thread Matthias De Smet
Wow, great tip! This fixed it!

Thanks a bunch!
Matthias


> Op 26 jan. 2016, om 15:20 heeft Hans-Rudolf Hotz  het volgende 
> geschreven:
> 
> Hi Matthias
> 
> 
> Make sure 'listing' is a list of (displayName,value,boolean)
> 
> Though, there might be other errors as well
> 
> 
> Regards, Hans-Rudolf
> 
> I am not sure, whether this
> On 01/26/2016 01:22 PM, Matthias De Smet wrote:
>> Hi all,
>> 
>> I’m trying to develop a tool that lets you select a file on the server.
>> I’m using the dynamic_options setting to let Galaxy render a dropdown
>> list of available file.
>> 
>> 
>> However, when I try to test the tool in its current form, I get the
>> following error:
>> 
>> 
>> galaxy.web.framework.decorators ERROR 2016-01-26 13:08:35,649 Uncaught
>> exception in exposed API method:
>> Traceback (most recent call last):
>>   File "lib/galaxy/web/framework/decorators.py", line 260, in decorator
>> rval = func( self, trans, *args, **kwargs)
>>   File "lib/galaxy/webapps/galaxy/api/tools.py", line 98, in build
>> return tool.to_json(trans, kwd.get('inputs', kwd))
>>   File "lib/galaxy/tools/__init__.py", line 2602, in to_json
>> populate_state(trans, self.inputs, state_inputs, state_errors,
>> params.__dict__)
>>   File "lib/galaxy/tools/__init__.py", line 2471, in populate_state
>> state[input.name] = input.get_initial_value(trans, context,
>> history=history)
>>   File "lib/galaxy/tools/parameters/basic.py", line 984, in
>> get_initial_value
>> value = [ optval for _, optval, selected in options if selected ]
>> ValueError: too many values to unpack
>> 
>> 
>> My tool xml looks like this:
>> 
>> 
>> 
>> 
>>   from the archive to a data library
>>   
>>   
>> test.sh > $log
>>   
>>   
>> > label="Choose source archive">
>>   
>> 
>> 
>>   
>> 
>> 
>> > dynamic_options="list_files(archive_source,query)"/>
>> 
>>   
>> 
>>  
>>   
>> 
>> 
>>   
>>   
>> This tool copies data from and archive folder to your history. Keep in
>> mind this folder MUST be readable by Galaxy in order for this tool to work.
>>   
>> 
>> 
>> 
>> 
>> and the script called in the “code” tag looks like this
>> 
>> 
>> def list_files(dir,query): listing=[]
>> for fname in listdir(dir):
>>  fullpath = path.join(dir, fname) #only select datafiles, not md5
>> checksums
>>  if path.isfile(fullpath) and not fullpath.endswith(".md5"):
>>  listing.append( fname )
>> return listing
>> 
>> 
>> This script should return a list with filenames that should be displayed
>> in the dropdown list.
>> 
>> I’m tracking Galaxy release 15.10, running on a Ubuntu 14.04.3 server
>> 
>> Thanks for your help!
>> 
>> Matthias
>> 
>> 
>> 
>> 
>> 
>> 
>> ___
>> 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:
>>   https://lists.galaxyproject.org/
>> 
>> To search Galaxy mailing lists use the unified search at:
>>   http://galaxyproject.org/search/mailinglists/
>> 

___
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:
  https://lists.galaxyproject.org/

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

Re: [galaxy-dev] Python ValueError: too many values to unpack

2016-01-26 Thread Hans-Rudolf Hotz

Hi Matthias


Make sure 'listing' is a list of (displayName,value,boolean)

Though, there might be other errors as well


Regards, Hans-Rudolf

I am not sure, whether this
On 01/26/2016 01:22 PM, Matthias De Smet wrote:

Hi all,

I’m trying to develop a tool that lets you select a file on the server.
I’m using the dynamic_options setting to let Galaxy render a dropdown
list of available file.


However, when I try to test the tool in its current form, I get the
following error:


galaxy.web.framework.decorators ERROR 2016-01-26 13:08:35,649 Uncaught
exception in exposed API method:
Traceback (most recent call last):
   File "lib/galaxy/web/framework/decorators.py", line 260, in decorator
 rval = func( self, trans, *args, **kwargs)
   File "lib/galaxy/webapps/galaxy/api/tools.py", line 98, in build
 return tool.to_json(trans, kwd.get('inputs', kwd))
   File "lib/galaxy/tools/__init__.py", line 2602, in to_json
 populate_state(trans, self.inputs, state_inputs, state_errors,
params.__dict__)
   File "lib/galaxy/tools/__init__.py", line 2471, in populate_state
 state[input.name] = input.get_initial_value(trans, context,
history=history)
   File "lib/galaxy/tools/parameters/basic.py", line 984, in
get_initial_value
 value = [ optval for _, optval, selected in options if selected ]
ValueError: too many values to unpack


My tool xml looks like this:




   from the archive to a data library
   
   
 test.sh > $log
   
   
 
   
 
 
   
 
 
 

   
 
  
   
 
 
   
   
This tool copies data from and archive folder to your history. Keep in
mind this folder MUST be readable by Galaxy in order for this tool to work.
   




and the script called in the “code” tag looks like this


def list_files(dir,query): listing=[]
for fname in listdir(dir):
  fullpath = path.join(dir, fname) #only select datafiles, not md5
checksums
  if path.isfile(fullpath) and not fullpath.endswith(".md5"):
  listing.append( fname )
return listing


This script should return a list with filenames that should be displayed
in the dropdown list.

I’m tracking Galaxy release 15.10, running on a Ubuntu 14.04.3 server

Thanks for your help!

Matthias






___
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:
   https://lists.galaxyproject.org/

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


___
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:
 https://lists.galaxyproject.org/

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