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

doing inter_event example

Comments (0)

Files changed (16)

ginsfsm/examples/http/simple_http_server.py

 #                   Main
 #===============================================================
 if __name__ == "__main__":
-    ga_srv = GAplic('Server')
+    ga_srv = GAplic(name='Server', roles='')
     ga_srv.create_gobj(
         'server',
         SimpleHttpServer,

ginsfsm/examples/inter_event/banco/banco.ini

 
 [app:wsgi-server]
 use = egg:banco#main
-gaplic_name = banco
+gaplic_name = Gran-Villain
 application = wsgi-application
 GWsgiServer.host = 0.0.0.0
 GWsgiServer.port = 8001
 PyramidRoot.pyramid_router_url = __pyramid_router__
 GRouter.trace_router = true
 
+GRouter.static_routes = RobberA
+
+[RobberA]
+name = RobberA
+roles = financiera, bolsa, publicidad
+url = http://localhost:8002
+
 
 [app:wsgi-application]
 use = egg:banco#pyramid_app
-gaplic = banco
+gaplic = Gran-Villain
 
 pyramid.reload_templates = true
 pyramid.debug_authorization = true

ginsfsm/examples/inter_event/banco/banco/main.py

     else:
         raise Exception('You must supply a gaplic name in local_conf.')
 
-    ga = GAplic(gaplic_name, **local_conf)
+    ga = GAplic(
+        name=gaplic_name,
+        roles=('banco', 'financiera', 'bolsa', 'publicidad'),
+        **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi_server',

ginsfsm/examples/inter_event/banco/banco/pyramid_app/templates/mytemplate.pt

       </div>
     </div>
   </div>
-  <div id="footer">
+  <div>
     <div class="footer">&copy; Copyright 2013, ginsmar.</div>
   </div>
 </body>

ginsfsm/examples/sockjs/test_sockjs_server.py

         application = local_conf.pop('application')
     else:
         raise Exception('You must supply an wsgi application.')
-    ga = GAplic('ga', **local_conf)
+    ga = GAplic(name='ga', roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'test-sockjs',

ginsfsm/examples/wsgi/multiple_wsgi_server.py

     else:
         raise Exception('You must supply an wsgi application.')
 
-    ga = GAplic('Wsgi-Example', **local_conf)
+    ga = GAplic(name='Wsgi-Example', roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi-server',

ginsfsm/examples/wsgi/simple_wsgi_server.py

         application = local_conf.pop('application')
     else:
         raise Exception('You must supply an wsgi application.')
-    ga = GAplic('Wsgi-Example', **local_conf)
+    ga = GAplic(name='Wsgi-Example', roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi-server',

ginsfsm/gaplic.py

     from ginsfsm.gaplic import GAplic, setup_gaplic_thread
 
     # run one gaplic as thread
-    ga_srv = GAplic('Server')
+    ga_srv = GAplic(name='Server', roles='')
     srv_worker = setup_gaplic_thread(ga_srv)
     srv_worker.start()
 
-    ga_cli = GAplic('Client')
+    ga_cli = GAplic(name='Client', roles='')
 
     try:
         # run the main gaplic as main process
         from ginsfsm.gaplic import GAplic
 
         if __name__ == "__main__":
-            ga = GAplic(name='Example1')
+            ga = GAplic(name='Example1', roles='')
             ga.create_gobj('test_aplic', GPrincipal, None)
             try:
                 ga.start()

ginsfsm/protocols/sockjs/server/c_sockjs_server.py

     def start_up(self):
         """ Initialization zone.
         """
+        self.logger.info(
+            "==> Resource path of sockjs server: %s\n"
+            "==> Test connection with => %s%s/%s" % (
+            self.resource_path(),
+            'schema://host:port',  # TODO: get real values
+            self.resource_path(),
+            'info'))
         if self.config.subscriber is None:
             self.config.subscriber = self.parent
         self.subscribe_event(None, self.config.subscriber)

ginsfsm/scaffolds/multi_pyramid_wsgi/+package+/main.py_tmpl

     else:
         raise Exception('You must supply a wsgi server name in local_conf.')
 
-    ga = GAplic(gaplic_name, **local_conf)
+    ga = GAplic(name=gaplic_name, roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         wsgi_server_name,

ginsfsm/scaffolds/multiple_wsgi/+package+/main.py_tmpl

         application = local_conf.pop('application')
     else:
         raise Exception('You must supply an wsgi application.')
-    ga = GAplic('Wsgi-Example', **local_conf)
+    ga = GAplic(name='Wsgi-Example', roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi-server',

ginsfsm/scaffolds/simple_pyramid/+package+.ini_tmpl

 GSock.trace_dump = true
 GObj.trace_mach = true
 GObj.trace_creation = false
+GObj.trace_traverse = true
 
 PyramidRoot.pyramid_router_url = __pyramid_router__
 GRouter.trace_router = true

ginsfsm/scaffolds/simple_pyramid/+package+/main.py_tmpl

     else:
         raise Exception('You must supply a gaplic name in local_conf.')
 
-    ga = GAplic(gaplic_name, **local_conf)
+    ga = GAplic(name=gaplic_name, roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi_server',

ginsfsm/scaffolds/simple_pyramid/+package+/pyramid_app/templates/mytemplate.pt_tmpl

     <div id="bottom">
       <div class="bottom">
         <div id="left" class="align-right">
-          <h2>Search documentation</h2>
-          <form method="get" action="http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/search.html">
-                <input type="text" id="q" name="q" value="" />
-                <input type="submit" id="x" value="Go" />
-            </form>
+          <h2>Get sockjs server info</h2>
+          <form method="get" action="http://localhost:8000/__pyramid_router__/info">
+            <input type="submit" id="x" value="Get Sockjs Info" />
+          </form>
         </div>
         <div id="right" class="align-left">
           <h2>Pyramid links</h2>

ginsfsm/scaffolds/simple_wsgi/+package+/main.py_tmpl

         application = local_conf.pop('application')
     else:
         raise Exception('You must supply an wsgi application.')
-    ga = GAplic('Wsgi-Example', **local_conf)
+    ga = GAplic(name='Wsgi-Example', roles='', **local_conf)
     set_global_main_gaplic(ga)
     ga.create_gobj(
         'wsgi-server',

ginsfsm/tests/test_gaplic2.py

 
 
 def setup():
-    ga = GAplic('GAplic-Subprocess')
+    ga = GAplic(name='GAplic-Subprocess')
     ga.create_gobj(
         'principal-subprocess',
         GPrincipal,
     worker = setup_gaplic_process(ga)
     worker.start()
 
-    ga = GAplic('GAplic-Thread')
+    ga = GAplic(name='GAplic-Thread')
     ga.create_gobj(
         'principal-thread',
         GPrincipal,
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.