[Midas] pydas question

Chapman, Brian brchapman at ucsd.edu
Mon Apr 9 23:48:32 EDT 2012


Thanks for the e-mail. I've cc'd our system admin so he can check on
whether the web-api module is enabled. If it isn't by default, I'm
guessing that we have not activated it. I'm running Python 2.7 on an 11.10
Ubuntu instance. I installed pydas with easy_install. When I verify from
Colby that the web-api is activated, I'll try to step through some of your
examples. I was testing the code in ipython with the -pdb option, so it
would step into the debugger when the exception was thrown. However, since
the call loop was so deep, it wasn't very useful.


On 4/9/12 8:40 PM, "Michael Grauer" <michael.grauer at kitware.com> wrote:

>Hi Brian,
>We can definitely do with beefing up these docs.
>That is a strange error, I'm not sure what's happening. Is there any
>further stack trace or detailed error message you can provide?
>In order for pydas to work, you'll need to enable the web-api module
>in your Midas instance, through the Administration menu.  If that
>module isn't enabled, I don't think you'll get the error that you were
>getting though, as I tried disabling the web-api module, then calling
>with pydas and got:
>simplejson.decoder.JSONDecodeError: No JSON object could be decoded
>I ran through a few pydas example commands in a python interpreter
>just now, and will tell you what I did.  Maybe you can try these to
>see if you have any different luck.  First off, how did you install
>Pydas, and how long ago did you install?  I installed on my Linux box
>via "pip", which made sure all of my dependencies were satisfied.
>I have a Midas instance running on my local machine (localhost) at
>/midas3, so this the url I'll be using.
>Example 1) calling pydas.login (which didn't work for you)
>>>> import pydas
>>>> pydas.login()
>Server URL: http://localhost/midas3
>Email: my.user at email.com
>Password: mypassword
>### at this point the python interpreter printed out my session token
>and I had a valid pydas connection
>Example 2), a bit more manual, but doesn't need authentication for this
>>>> import pydas.core as core
>>>> comm = core.Communicator('http://localhost/midas3')
>>>> comm.get_server_version()
>Example 2 continued) getting the session token manually
>>>> token = comm.get_default_api_key('my.user at email.com, 'password')
>>>> token
>Hopefully this gets us a bit closer to figuring out the problem.
>On Mon, Apr 9, 2012 at 7:58 PM, Chapman, Brian <brchapman at ucsd.edu> wrote:
>> Hello Patrick and other Midas Helpers,
>> I'm trying to figure out how to use pydas for uploading large number of
>> files into our Midas repository at iDASH. Documentation seems a little
>> sparse although I did find the singe
>> page 
>> So just trying to use the pydas.login() function I get into trouble.  So
>> looking at the docstring and the function call definition, I see that it
>> takes arguemtns of url, email, password, and api_key. If none are
>> it prompts me for the email, url and password. No matter what I do here,
>> provide no arguments and respond to the prompts or provide the values
>>in the
>> function call I get the following RuntimeError: "maximum recursion depth
>> exceeded in __instancecheck__"
>> The code is choking on the get)_default_api_key() call.
>> Does Midas need to have any special configuration for use of pydas?
>>Just at
>> a bit of a loss as to why this is failing.
>> Brian
>> Brian E. Chapman, PhD
>> Associate Professor
>> Division of Biomedical Informatics
>> University of California, San Diego
>> _______________________________________________
>> Midas mailing list
>> Midas at public.kitware.com
>> http://public.kitware.com/cgi-bin/mailman/listinfo/midas
>Michael Grauer
>R & D Engineer
>Kitware, Inc.
>919 969 6990 x322

More information about the Midas mailing list