Rob,

The request below library_create_library looks like it has the wrong url, it should be:

./library_create_library.py 8c25bc83f6f9e4001dd21eb7b64f063f http://localhost:8080/api/libraries api_test 'API Test Library'

-Dannon

On Fri, Mar 8, 2013 at 11:40 AM, Rob Leclerc <robert.leclerc@gmail.com> wrote:
I'm have the same error when I run library_create_library.py with the documentation laid out in the galaxy-central/tip//scrips/api/README

from:

/galaxy-dist/scripts/api/


% ./library_create_library.py 8c25bc83f6f9e4001dd21eb7b64f063f http://localhost:8080/libraries api_test 'API Test Library'

Traceback (most recent call last):
  File "./library_create_library.py", line 19, in <module>
    submit( sys.argv[1], sys.argv[2], data )
  File "./common.py", line 100, in submit
    r = post( api_key, url, data )
  File "./common.py", line 42, in post
    return simplejson.loads( urllib2.urlopen( req ).read() )
  File "build/bdist.macosx-10.6-intel/egg/simplejson/__init__.py", line 384, in loads
  File "build/bdist.macosx-10.6-intel/egg/simplejson/decoder.py", line 402, in decode
  File "build/bdist.macosx-10.6-intel/egg/simplejson/decoder.py", line 420, in raw_decode
simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)

-Rob



On Fri, Mar 8, 2013 at 11:23 AM, Sytchev, Ilya <isytchev@hsph.harvard.edu> wrote:
JSONDecodeError will be raised if the given JSON document is not valid.

Ilya

From: Rob Leclerc <robert.leclerc@gmail.com>
Date: Friday, March 8, 2013 12:01 AM
To: "galaxy-dev@bx.psu.edu" <galaxy-dev@bx.psu.edu>
Subject: [galaxy-dev] BioBlend: Problem Running Example file

I had trouble running blend4j, so I tried to jump into python (a language I have little experience with).

I tried running the example run_import_workflow.py 

% python run_imported_workflow.py http://localhost:8080 8c25bc83f6f9e4001dd21eb7b64f063f

but I get an error:

Initiating Galaxy connection
Importing workflow
Creating data library 'Imported data for API demo'

Traceback (most recent call last):
  File "run_imported_workflow.py", line 53, in <module>
    library_dict = gi.libraries.create_library(library_name)
  File "build/bdist.macosx-10.6-intel/egg/bioblend/galaxy/libraries/__init__.py", line 27, in create_library
  File "build/bdist.macosx-10.6-intel/egg/bioblend/galaxy/client.py", line 53, in _post
  File "build/bdist.macosx-10.6-intel/egg/bioblend/galaxy/__init__.py", line 132, in make_post_request
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-1.1.0-py2.7.egg/requests/models.py", line 604, in json
    return json.loads(self.text or self.content)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson-3.1.0-py2.7-macosx-10.6-intel.egg/simplejson/__init__.py", line 454, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson-3.1.0-py2.7-macosx-10.6-intel.egg/simplejson/decoder.py", line 374, in decode
    obj, end = self.raw_decode(s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson-3.1.0-py2.7-macosx-10.6-intel.egg/simplejson/decoder.py", line 393, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Is there anything I am missing from the stock configuration which would cause this not to run out of the box?

Cheers,
Rob



--
Rob Leclerc, PhD
P: (Shanghai) +86-1-(861)-612-5469
Personal Email: rob.leclerc@aya.yale.edu

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