[Osaas-commits] r10 - in trunk: . server/osaas

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 28 14:45:11 CEST 2007


Author: bh
Date: 2007-08-28 14:45:11 +0200 (Tue, 28 Aug 2007)
New Revision: 10

Modified:
   trunk/ChangeLog
   trunk/server/osaas/run.py
Log:
* server/osaas/run.py (OSAASServerProgram, OSAASProgramMixin):
Split the configuration handling -- the read_config_file method
and the optparse_option_class -- from OSAASServerProgram into the
new mix-in class OSAASProgramMixin.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-08-28 10:54:28 UTC (rev 9)
+++ trunk/ChangeLog	2007-08-28 12:45:11 UTC (rev 10)
@@ -1,5 +1,12 @@
 2007-08-28  Bernhard Herzog  <bh at intevation.de>
 
+	* server/osaas/run.py (OSAASServerProgram, OSAASProgramMixin):
+	Split the configuration handling -- the read_config_file method
+	and the optparse_option_class -- from OSAASServerProgram into the
+	new mix-in class OSAASProgramMixin.
+
+2007-08-28  Bernhard Herzog  <bh at intevation.de>
+
 	* server/osaas/formparser.py (Field.deserialize): New method to
 	support non-string data types
 	(DateField): New class for fields with date/time values

Modified: trunk/server/osaas/run.py
===================================================================
--- trunk/server/osaas/run.py	2007-08-28 10:54:28 UTC (rev 9)
+++ trunk/server/osaas/run.py	2007-08-28 12:45:11 UTC (rev 10)
@@ -9,10 +9,17 @@
 from osaas.server import OSAASServer
 from osaas.config import OSAASOption, read_config_file
 
-class OSAASServerProgram(ServerProgram):
+class OSAASProgramMixin:
 
     optparse_option_class = OSAASOption
 
+    def read_config_file(self, opts):
+        if opts.config_file is not None:
+            read_config_file(opts.config_file, opts)
+
+
+class OSAASServerProgram(OSAASProgramMixin, ServerProgram):
+
     def create_option_parser(self, **kw):
         parser = ServerProgram.create_option_parser(self, **kw)
         for name in ["port", "access-log", "error-log"]:
@@ -25,9 +32,6 @@
     def instantiate_server(self, server_class, server_address, opts, **kw):
         return server_class(server_address, userdbfile=opts.userdb_file, **kw)
 
-    def read_config_file(self, opts):
-        if opts.config_file is not None:
-            read_config_file(opts.config_file, opts)
 
 
 def main():



More information about the Osaas-commits mailing list