Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        def import_app(module):
    parts = module.split(":", 1)
    if len(parts) == 1:
        module, obj = module, "serve_forever"
    else:
        module, obj = parts[0], parts[1]

    try:
        __import__(module)
    except ImportError:
        if module.endswith(".py") and os.path.exists(module):
            raise ImportError("Failed to find application, did "
                "you mean '%s:%s'?" % (module.rsplit(".", 1)[0], obj))
        else:
            raise

    mod = sys.modules[module]
    app = eval(obj, mod.__dict__)
    if app is None:
        raise ImportError("Failed to find application object: %r" % obj)
    if not callable(app):
        raise TypeError("Application object must be callable.")
    return app
        


src/g/r/GRunner-0.3.4/grunner/runner.py   GRunner(Download)
        """
        try:
            func = util.import_app(self.target)
        except Exception, e:
            self.booted = False