commit-gnue
[Top][All Lists]
Advanced

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

r5177 - trunk/gnue-appserver/src/classrep


From: reinhard
Subject: r5177 - trunk/gnue-appserver/src/classrep
Date: Fri, 27 Feb 2004 08:32:31 -0600 (CST)

Author: reinhard
Date: 2004-02-27 08:32:30 -0600 (Fri, 27 Feb 2004)
New Revision: 5177

Modified:
   trunk/gnue-appserver/src/classrep/SchemaSupport.py
Log:
Removed some dead code.


Modified: trunk/gnue-appserver/src/classrep/SchemaSupport.py
===================================================================
--- trunk/gnue-appserver/src/classrep/SchemaSupport.py  2004-02-27 10:35:32 UTC 
(rev 5176)
+++ trunk/gnue-appserver/src/classrep/SchemaSupport.py  2004-02-27 14:32:30 UTC 
(rev 5177)
@@ -21,22 +21,14 @@
 #
 # $Id$
 
-from gnue.appserver.classrep import Namespace
-
-# read schema support
-from gnue.common.schema import GSParser
-from gnue.common.utils.FileUtils import openResource, dyn_import
-
-# write schema support
-from gnue.common.schema.Objects import *
-from gnue.common.definitions.GParserHelpers import GContent
-from types import StringType, UnicodeType
-
 import sys
+import types
 import mx.DateTime.ISO
 import re
+from gnue.common.schema.Objects import *
+from gnue.common.definitions.GParserHelpers import GContent
+from gnue.appserver.classrep import Namespace
 
-
 # =============================================================================
 # Exceptions: Base exception class
 # =============================================================================
@@ -268,10 +260,10 @@
       if native is None:
         return ""
 
-      if isinstance (native, UnicodeType):
+      if isinstance (native, types.UnicodeType):
         return native.encode ('utf-8')
 
-      elif isinstance (native, StringType):
+      elif isinstance (native, types.StringType):
         return native
 
       else:
@@ -345,38 +337,6 @@
       raise EInvalidType (datatype)
 
 
-
-
-  # ---------------------------------------------------------------------------
-  # Load a Schema from a file and store it in the class repository
-  # Parameter: filename:  name of file to load
-  #            overwrite: if true, old class definitions will be removed
-  #            install:   if true, database tables for the class will be 
created
-  # TODO: a) make this code transactional, i.e. first check, if everything can 
-  #          be done without breaks, then execute.
-  #       b) add global class repository locking
-  # ---------------------------------------------------------------------------
-  def loadSchemaFromFile (self, filename, overwrite=0, install=0):
-    input = openResource (filename)
-    schema = GSParser.loadFile (input)
-
-    for table in schema.findChildrenOfType ('GSTable', allowAllChildren = 1):
-      print 'adding Table %s' % table.name
-
-      for field in table.findChildrenOfType ('GSField', allowAllChildren = 1):
-        print '   with field %s:' % field.name
-
-    if overwrite:
-      raise 'Overwrite support not working yet.'
-      
-    if install:
-      # TODO: this job should be done in a quite general way,
-      #       to let the code be reused in reaction on  manual class
-      #       repository changes.
-      raise 'Creation of Schema tables is not supported yet'
-
-
-
 # =============================================================================
 # test program
 # =============================================================================





reply via email to

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