Ginés Martínez Sánchez avatar Ginés Martínez Sánchez committed 885a2b9 Draft

borro test_router_with_pyramid

Comments (0)

Files changed (2)

ginsfsm/examples/router/test_router_with_pyramid.ini

-[composite:main]
-use = call:ginsfsm.gaplic:gaplic_factory
-main = wsgi-server
-wsgi = wsgi-application
-
-[app:wsgi-server]
-use = call:ginsfsm.examples.router.test_router:main
-gaplic-name = router1
-wsgi-server.host = 0.0.0.0
-wsgi-server.port = 8080
-application = wsgi-application
-GSock.trace_dump = true
-# GObj: super-global setter.
-#GObj.trace_mach = true
-GObj.trace_traverse = true
-GWebSocket.trace_mach = true
-
-[app:wsgi-application]
-use = call:ginsfsm.examples.router.test_router:paste_app_factory
-gaplic = router1
-
-
-# Begin logging configuration
-
-[loggers]
-keys = root, ginsfsm
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-[logger_root]
-level = DEBUG
-handlers = console
-
-[logger_ginsfsm]
-level = DEBUG
-handlers =
-qualname = ginsfsm
-
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-[formatter_generic]
-format = %(message)s
-
-# End logging configuration

ginsfsm/examples/router/test_router_with_pyramid.py

-# -*- encoding: utf-8 -*-
-"""
-Router in own ports
-===================
-"""
-
-from ginsfsm.gaplic import GAplic
-from ginsfsm.globals import (
-    set_global_app,
-    set_global_main_gaplic,
-)
-
-from ginsfsm.protocols.wsgi.server.c_wsgi_server import GWsgiServer
-
-
-#===============================================================
-#       Paste app factory.
-#       To run with gserve yyy.ini
-#===============================================================
-def paste_app_factory(global_config, **local_conf):
-    from ginsfsm.examples.sockjs.test_sockjs_apps import pyramid_application
-    return pyramid_application(global_config, **local_conf)
-
-
-#===============================================================
-#                   Main
-#===============================================================
-def main(global_config, **local_conf):
-    """ Entry point to run with gserve (PasteDeploy)
-    """
-    if 'application' in local_conf:
-        application = local_conf.pop('application')
-    else:
-        raise Exception('You must supply an wsgi application')
-
-    if 'gaplic-name' in local_conf:
-        gaplic_name = local_conf.pop('gaplic-name')
-    else:
-        raise Exception('You must supply an gaplic name ("gaplic-name")')
-
-    ga = GAplic(gaplic_name, **local_conf)
-    set_global_main_gaplic(ga)
-    ga.create_gobj(
-        'wsgi-server',
-        GWsgiServer,
-        ga,
-        application=application,
-    )
-    return ga
-
-
-if __name__ == "__main__":
-    """ You can run directly this file, without gserve.
-    """
-    import logging
-    logging.basicConfig(level=logging.DEBUG)
-    # simulate running from ini file
-    local_conf = {
-        'GObj.trace_mach': False,
-        'gaplic-name': 'router1',
-        'GObj.logger': logging,
-        'GSock.trace_dump': True,
-        'wsgi-server.host': '0.0.0.0',
-        'wsgi-server.port': 8080,
-        'application': 'wsgi-application',
-    }
-
-    ga = main({}, **local_conf)
-
-    applic_settings = {
-        'gaplic': 'router1'
-    }
-
-    set_global_app(
-        'wsgi-application',
-        paste_app_factory({}, **applic_settings)
-    )
-
-    try:
-        ga.run_forever()
-    except (KeyboardInterrupt, SystemExit):
-        print('Program stopped')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.