Commits

Ginés Martínez Sánchez committed 8c9d028 Draft

developing wsgi server

  • Participants
  • Parent commits f071a9f

Comments (0)

Files changed (2)

File ginsfsm/c_sock.py

         "subcriber of all output-events."
         "Default is ``None``, i.e., the parent"
         ],
+    'trace_dump': [bool, False, 0, None, "trace tx/rx messages"],
     'ip': [str, '', 0, None, ""],
     'host': [str, '', 0, None, "server or client host (ip or name)"],
     'port': [int, 0, 0, None, "server or client port"],

File ginsfsm/examples/wsgi/simple_wsgi_server.py

 logging.basicConfig(level=logging.DEBUG)
 
 from ginsfsm.gaplic import GAplic
-from ginsfsm.smachine import SMachine
-from ginsfsm.c_sock import GSock
 from ginsfsm.protocols.wsgi.server.c_wsgi_server import GWsgiServer
 
 
 #===============================================================
 #                   Main
 #===============================================================
-def main(global_config, **global_settings):
+def main(global_config, **local_conf):
     """ Entry point to run with gserve (PasteDeploy)
     """
-    ga = GAplic('Wsgi-Example', **global_settings)
+    ga = GAplic('Wsgi-Example', **local_conf)
     ga.create_gobj(
         'wsgi-server',
         GWsgiServer,
 
 
 if __name__ == "__main__":
-    global_settings = {
-        'trace_mach': True,
-        'logger': logging,
+    local_conf = {
+        'GObj.trace_mach': True,
+        'GObj.logger': logging,
+        'GSock.trace_dump': True,
     }
-    SMachine._global_trace_mach = True
-    GSock._global_trace_dump = True
-    ga = main({}, **global_settings)
+    ga = main({}, **local_conf)
 
     try:
         ga.mt_process()