[Erp5-report] r14154 - in /erp5/trunk/utils/oood: config.py runserw.py start.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Apr 22 01:18:49 CEST 2007


Author: bartek
Date: Sun Apr 22 01:18:47 2007
New Revision: 14154

URL: http://svn.erp5.org?rev=14154&view=rev
Log:
optional use of "implementation 2" (new dispatcher)

Modified:
    erp5/trunk/utils/oood/config.py
    erp5/trunk/utils/oood/runserw.py
    erp5/trunk/utils/oood/start.py

Modified: erp5/trunk/utils/oood/config.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/config.py?rev=14154&r1=14153&r2=14154&view=diff
==============================================================================
--- erp5/trunk/utils/oood/config.py (original)
+++ erp5/trunk/utils/oood/config.py Sun Apr 22 01:18:47 2007
@@ -29,6 +29,14 @@
 ##############################################################################
 
 import logging
+
+###################################################################
+# Implementation
+###################################################################
+
+# 1 - the old implementation, using serw module
+# 2 - the new one, using dispatcher module
+implementation = 1
 
 ###################################################################
 # System config

Modified: erp5/trunk/utils/oood/runserw.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/runserw.py?rev=14154&r1=14153&r2=14154&view=diff
==============================================================================
--- erp5/trunk/utils/oood/runserw.py (original)
+++ erp5/trunk/utils/oood/runserw.py Sun Apr 22 01:18:47 2007
@@ -126,7 +126,14 @@
     #########################################################
     ## Run the XML-RPC server
     #########################################################
-    from serw import *
+    import config
+    if config.implementation == 1:
+      from serw import *
+      Dispatcher = Procesor
+    elif config.implementation == 2:
+      from dispatcher import *
+    else:
+      raise NotImplementedError('you are trying to use a non-existent implementation')
 
     if debug:
       Log.info("Server - Started in debug mode")
@@ -155,7 +162,7 @@
     atexit.register(at_exit_handler, lock_file_path)
 
     # Start the server core
-    proc = Procesor()
+    disp = Dispatcher()
 
     # Some debug stuff
     if debug:
@@ -166,7 +173,7 @@
 
     # Run the server forever
     ser = MySerw((config.server_host, config.server_port), allow_none = True)
-    ser.register_instance(proc)
+    ser.register_instance(disp)
     Log.info("Server - Will serve indefinitely until you kill or interrupt it...")
     ser.serve_forever()
 

Modified: erp5/trunk/utils/oood/start.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/start.py?rev=14154&r1=14153&r2=14154&view=diff
==============================================================================
--- erp5/trunk/utils/oood/start.py (original)
+++ erp5/trunk/utils/oood/start.py Sun Apr 22 01:18:47 2007
@@ -268,6 +268,9 @@
       usage()
       sys.exit(0)
     elif o in ("-i", "--init"):
+      if config.implementation > 1:
+        print "You are using new implementation of oood; no need to run start.py --init"
+        sys.exit(0)
       startVirtualFrameBuffer()
       initPool()
       sys.exit(0)




More information about the Erp5-report mailing list