gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] GNUmed web interface - pyjamas


From: Sebastian Hilbert
Subject: Re: [Gnumed-devel] GNUmed web interface - pyjamas
Date: Mon, 12 Jul 2010 07:48:45 +0200
User-agent: KMail/1.13.3 (Linux/2.6.33-6-desktop; KDE/4.4.5; i686; ; )

Am Sonntag 11 Juli 2010, 22:59:52 schrieb lkcl:
> ok try this:
> 
> http://lkcl.net/gnumed/0001-jsonrpc-cherrypy-test.patch
> 
> run the testjsonrpc.py script.
> 
> you will need (with python2.5)
> apt-get install simplejson
> which you will NOT need with python2.6
> 
> you will need http://lkcl.net/jsonrpclib.tgz
> unpack and python setup.py install
> 
> due to cherrypy psycopg2 integration being a bit of a failure, i'm getting
> "psycopg2 pool exhausted" messages after the second and all subsequent
> connection attempts, and the cherrypy service needs to be restarted.
> 
> this is obviously bad, and i am not enough of an expert on cherrypy to know
> what to do.
> 
> but, at least this proves how you can do JSONRPC.
> 
> in the function get_doc_types() you can see for item in
> gmDocuments.get_document_types() blah blah but rather than turn the results
> into a jsonclass "hint" dictionary i have simply str()'d them for now.
> 
> to do a "proper" job, you would need some introspection which went and
> analysed the objects:
> 
>   ditem = {'__jsonclass__': ["jsonmodule.%s" % item.__class__.__name__],
>                   'foo': item.foo,
>                   'bar': item.bar,
>                  }
> 
>  which is exactly the kind of thing that's blindingly-obviously
> automatable.
> 
>  the reason for the insertion of "jsonmodule" is so that the javascript
> (actually the pyjs compiler or the python behind the pyjamas-desktop) knows
> to pick up {classname} from python module "jsonmodule".
> 
>  this will become relevant / clearer when i create a pyjamas app which
> actually uses it.
> 
>  so, one on the TODO list for you already: solve the psycopg2 problem, or
> find a better framework.
>
Will do that today. The use of cherrypy has by far not been an educated 
choice. In the beginning when I was looking at the frameworks it just happened 
to have a tutorial available letting me create a login dialog.

I will see what I can do.

Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]