pyAMF for GAE(Google App Engine),需要很少的帮助:
# I need this behaviour:
# 1) check if the service from flash is included in the services array
# 2) if not, return false or an error | if yes, step 3
# 3) combine the rootPath('app.controllers') with the service name('sub1.sub2.sub3.function_name')
# 4) and then get the function('function_name') from the 'app.controllers.sub1.sub2.sub3.function_name' package
# 5) then run the function the way that would be done normally by pyAMF
from app.controllers.users.login import login
from app.controllers.users.logout import logout
from app.controllers.profiles.edit import edit as profilesEdit
from app.controllers.profiles.new import new as profilesNew
from app.controllers.invitations.invite import invite as invitationsInvite
from app.controllers.invitations.uninvite import uninvite as invitationsUninvite
def main():
services = {
'users.login': login,
'users.logout': logout,
'profiles.edit': profilesEdit,
'profiles.new': profilesNew,
'invitations.invite': invitationsInvite,
'invitations.uninvite': invitationsUninvite
}
gateway = WebAppGateway(services, logger=logging, debug=True)
application = webapp.WSGIApplication([('/', Init),
('/ajax', gateway)], debug=True)
run_wsgi_app(application)
我想插入这个:
def main():
services = [
'users.login',
'users.logout',
'profiles.edit',
'profiles.new',
'invitations.invite',
'invitations.uninvite',
'sub1.sub2.sub3.function_name'
]
rootPath = 'app.controllers'
gateway = WebAppGateway(services, rootPath, logger=logging, debug=True)
application = webapp.WSGIApplication([('/', Init),
('/ajax', gateway)], debug=True)
run_wsgi_app(application)
# and then I would extend the WebAppGateway in some way to have this behaviour:
# 1) check if the service from flash is included in the services array
# 2) if not, return false or an error | if yes, step 3
# 3) combine the rootPath('app.controllers') with the service name('sub1.sub2.sub3.function_name')
# 4) and then get the function('function_name') from the 'app.controllers.sub1.sub2.sub3.function_name' package
# 5) then run the function the way that would be done normally by pyAMF
这可能吗?谢谢
# I need this behaviour:
# 1) check if the service from flash is included in the services array
# 2) if not, return false or an error | if yes, step 3
# 3) combine the rootPath('app.controllers') with the service name('sub1.sub2.sub3.function_name')
# 4) and then get the function('function_name') from the 'app.controllers.sub1.sub2.sub3.function_name' package
# 5) then run the function the way that would be done normally by pyAMF
from app.controllers.users.login import login
from app.controllers.users.logout import logout
from app.controllers.profiles.edit import edit as profilesEdit
from app.controllers.profiles.new import new as profilesNew
from app.controllers.invitations.invite import invite as invitationsInvite
from app.controllers.invitations.uninvite import uninvite as invitationsUninvite
def main():
services = {
'users.login': login,
'users.logout': logout,
'profiles.edit': profilesEdit,
'profiles.new': profilesNew,
'invitations.invite': invitationsInvite,
'invitations.uninvite': invitationsUninvite
}
gateway = WebAppGateway(services, logger=logging, debug=True)
application = webapp.WSGIApplication([('/', Init),
('/ajax', gateway)], debug=True)
run_wsgi_app(application)
insted of this I would like:
def main():
services = [
'users.login',
'users.logout',
'profiles.edit',
'profiles.new',
'invitations.invite',
'invitations.uninvite',
'sub1.sub2.sub3.function_name'
]
rootPath = 'app.controllers'
gateway = WebAppGateway(services, rootPath, logger=logging, debug=True)
application = webapp.WSGIApplication([('/', Init),
('/ajax', gateway)], debug=True)
run_wsgi_app(application)
# and then I would extend the WebAppGateway in some way to have this behaviour:
# 1) check if the service from flash is included in the services array
# 2) if not, return false or an error | if yes, step 3
# 3) combine the rootPath('app.controllers') with the service name('sub1.sub2.sub3.function_name')
# 4) and then get the function('function_name') from the 'app.controllers.sub1.sub2.sub3.function_name' package
# 5) then run the function the way that would be done normally by pyAMF
is this possible? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
昨晚解决了!谢谢@njoyce
Solved last night! thanks @njoyce