[Midas] pydas question

Michael Grauer michael.grauer at kitware.com
Mon Apr 9 23:40:55 EDT 2012


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 call

>>> import pydas.core as core
>>> comm = core.Communicator('http://localhost/midas3')
>>> comm.get_server_version()
'3.2.3'

Example 2 continued) getting the session token manually

>>> token = comm.get_default_api_key('my.user at email.com, 'password')
>>> token
'dcc90e81da77d774bcaf44c4c1d9648c'


Hopefully this gets us a bit closer to figuring out the problem.

-Mike



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 http://www.kitware.com/midaswiki/index.php/Documentation/3.2.0/Client/User/Other/Pydas
>
> 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 provided
> 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
>



-- 
Thanks,
Michael Grauer
R & D Engineer
Kitware, Inc.
919 969 6990 x322



More information about the Midas mailing list