commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5384 - trunk/gnue-appserver/src


From: reinhard
Subject: r5384 - trunk/gnue-appserver/src
Date: Fri, 19 Mar 2004 14:03:38 -0600 (CST)

Author: reinhard
Date: 2004-03-19 14:03:37 -0600 (Fri, 19 Mar 2004)
New Revision: 5384

Modified:
   trunk/gnue-appserver/src/geasGsdGen.py
Log:
Enabled --database option for gnue-gsdgen.


Modified: trunk/gnue-appserver/src/geasGsdGen.py
===================================================================
--- trunk/gnue-appserver/src/geasGsdGen.py      2004-03-19 19:50:53 UTC (rev 
5383)
+++ trunk/gnue-appserver/src/geasGsdGen.py      2004-03-19 20:03:37 UTC (rev 
5384)
@@ -26,6 +26,7 @@
 from gnue.common.apps import i18n
 from gnue.common.apps.GClientApp import *
 
+from gnue.appserver import VERSION
 from gnue.appserver.geasSessionManager import geasSessionManager 
 from gnue.appserver.classrep.SchemaSupport import *
 from gnue.appserver.classrep.Namespace import *
@@ -37,27 +38,42 @@
 class geasGsdGen (GClientApp):
 
   NAME    = "geasGsdGen"
-  VERSION = "0.0.1"
+  VERSION = VERSION
   COMMAND = "gnue-gsdgen"
+  USAGE   = "%s %s" % (GClientApp.USAGE, " [classname] [classname] [...]")
   SUMMARY = _(
 """A tool to create GNUe Schema Definition (gsd) files from 
 the appservers class repository.""")
-  USAGE   = "%s %s" % (GClientApp.USAGE, " [classname] [classname] [...]")
+
   COMMAND_OPTIONS = [
+
     ['output', 'o', 'output-file', True, None, "file",
       _('Name of the resulting gsd-file')],
+
     ['export', 'e', 'export', True, None, "type",
-      _('What to export: "schema", "data", "both". Default is "both"')]
-  ]
+      _('What to export: "schema", "data", "both". Default is "both"')],
 
+    ['database', None, 'database', 1, None, 'name', _(
+"""Set the Database to use for loading and storing data to <name>.
+gnue-appserver will search for it in connections.conf.""")]]
+
   # ---------------------------------------------------------------------------
   # Constructor
   # ---------------------------------------------------------------------------
   def __init__ (self, connections = None):
+
     ConfigOptions = {}
+
     GClientApp.__init__ (self, connections, 'appserver', ConfigOptions)
 
+    self.configurationManager.registerAlias ('gConfig', 'appserver')
 
+    # overwrite configuration settings by command line parameters
+    cparser = self.configurationManager._loadedConfigs ['gnue.conf']
+
+    if self.OPTIONS ["database"] != None:
+      cparser.set ('appserver', 'database', self.OPTIONS ["database"])
+
   # ---------------------------------------------------------------------------
   # Print a message to stdout, if output is sent to a file
   # ---------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]