Quantcast

PyAMF with the latest Google App Engine

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PyAMF with the latest Google App Engine

Hyunil Kim
Hi all,

I am quite new to Python itself and am seeking a help with setting up a gateway with the latest PyAMF along with Google App Engine. I have gone through tutorial, but the difference I see is that with the latest Google App Engine SDK, it uses webapp2 instead of webapp.

I am using WSGIGateway to set up the services, and webapp2 to run the application. When I try to call a service method from my Flash client I get:

ERROR    2013-03-27 09:00:14,040 webapp2.py:1552] __call__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1065, in __call__
    return self.handler(request, *args, **kwargs)
TypeError: __call__() takes exactly 3 arguments (2 given)
INFO     2013-03-27 09:00:14,063 server.py:528] "POST /gateway HTTP/1.1" 500 1555

My code looks like:


import webapp2
from server.amf_gateway import create_gateway


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('Server is running...')


application_paths = [('/', MainPage), ('/gateway', create_gateway(True))]
app = webapp2.WSGIApplication(application_paths, True)


FYI, create_gateway() creates and returns a WSGIGateway instance.

Any idea how I can resolve this error?

Thanks,

Hyunil

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PyAMF with the latest Google App Engine

Stuart Mitchell-3
I think this change fixes it.

the pull request has been on git hub for a while



On Wed, Mar 27, 2013 at 10:19 PM, Hyunil Kim <[hidden email]> wrote:
Hi all,

I am quite new to Python itself and am seeking a help with setting up a gateway with the latest PyAMF along with Google App Engine. I have gone through tutorial, but the difference I see is that with the latest Google App Engine SDK, it uses webapp2 instead of webapp.

I am using WSGIGateway to set up the services, and webapp2 to run the application. When I try to call a service method from my Flash client I get:

ERROR    2013-03-27 09:00:14,040 webapp2.py:1552] __call__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1065, in __call__
    return self.handler(request, *args, **kwargs)
TypeError: __call__() takes exactly 3 arguments (2 given)
INFO     2013-03-27 09:00:14,063 server.py:528] "POST /gateway HTTP/1.1" 500 1555

My code looks like:


import webapp2
from server.amf_gateway import create_gateway


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('Server is running...')


application_paths = [('/', MainPage), ('/gateway', create_gateway(True))]
app = webapp2.WSGIApplication(application_paths, True)


FYI, create_gateway() creates and returns a WSGIGateway instance.

Any idea how I can resolve this error?

Thanks,

Hyunil

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Loading...