Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1038747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:00:50+00:00 2026-05-16T15:00:50+00:00

In a normal application i set services services = { ‘users.login’: login, ‘test’: router

  • 0

In a normal application i set services

services = {
    'users.login': login,
    'test': router
}

but I would like to do like this:

services = [
    'users.login',
    'test'
]

and every request goes to router function. this takes 2 params: service name (can be “users.login” or “test” in this case) and input (that is the object sent by flex to python)
then if the command(service) from flex is named “users.login”. I would like to run the router with the params and then this will open the function login in the commands.users.login package. How would I do that? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:00:51+00:00Added an answer on May 16, 2026 at 3:00 pm

    Solved last night!

    from pyamf.remoting.gateway.google import WebAppGateway
    import logging
    
    class TottysGateway(WebAppGateway):
    def __init__(self, services_available, root_path, not_found_service, logger, debug):
        # override the contructor and then call the super
        self.services_available = services_available
        self.root_path = root_path
        self.not_found_service = not_found_service
        WebAppGateway.__init__(self, {}, logger=logging, debug=True)
    
    def getServiceRequest(self, request, target):
        # override the original getServiceRequest method
        try:
            # try looking for the service in the services list
            return WebAppGateway.getServiceRequest(self, request, target)
        except:
            pass
    
        try:
            # don't know what it does but is an error for now
            service_func = self.router(target)
        except:
            if(target in self.services_available):
                # only if is an available service import it's module
                # so it doesn't access services that should be hidden
                try:
                    module_path = self.root_path + '.' + target
                    paths = target.rsplit('.')
                    func_name = paths[len(paths) - 1]
                    import_as = '_'.join(paths) + '_' + func_name
                    import_string = "from "+module_path+" import "+func_name+' as service_func'
                    exec import_string
                except:
                    service_func = False
    
        if(not service_func):
            # if is not found load the default not found service
            module_path = self.rootPath + '.' + self.not_found_service
            import_string = "from "+module_path+" import "+func_name+' as service_func'
    
        # add the service loaded above
        assign_string = "self.addService(service_func, target)"
        exec assign_string
    
        return WebAppGateway.getServiceRequest(self, request, target)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded from Grails 1.3.7 to Grails 2.0.1. The application runs normal, but
Until yesterday everything was normal but today i try to lauch my application using
I get many normal log lines in my google app engine application. But today
The following code is working great in a normal console application: private void button1_Click(object
I am developing an android app using code from a normal java application. In
I have a normal textbox in my application. I can paste data to it
Is it normal/recommended to make interfaces for the entities in an application? If it
I have a monodroid application that uses a .net library that contains normal .resx
In my application I set up the locale when the user get into the
I have basic authentication set up in a simple CakePHP 2.0 application. I first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.