/[gnue]/gnue-common/src/datasources/GIntrospection.py
ViewVC logotype

Diff of /gnue-common/src/datasources/GIntrospection.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jcater, Tue Nov 25 19:39:57 2003 UTC revision 1.4 by jcater, Tue Nov 25 19:53:13 2003 UTC
# Line 27  Line 27 
27  #   Old methods in GDataObjects and their new counterparts:  #   Old methods in GDataObjects and their new counterparts:
28  #     * getSchemaTypes()       -->  types  #     * getSchemaTypes()       -->  types
29  #     * getSchemaList()        -->  find(type='...')  #     * getSchemaList()        -->  find(type='...')
30  #     * getSchemaByName()      -->  find(name='...')  #     * getSchemaByName()      -->  findone(name='...')
31  #     * writeSchema()          -->  write()  #     * writeSchema()          -->  write()
32  #  #
33  #  Preferred way to access these discovery routines is:  #  Preferred way to access these discovery routines is:
# Line 36  Line 36 
36    
37  import string  import string
38    
39    import Exceptions
40    
41  #  #
42  # Schema (metadata) functions  # Schema (metadata) functions
# Line 55  class Introspection: Line 56  class Introspection:
56    def find(self, name=None, type=None):    def find(self, name=None, type=None):
57      return []      return []
58    
59      def findone(self, *args, **parms):
60    def findfirst(self, *args, **parms):      f = self.find(*args, **parms)
61      return self.find(*args, **parms)[0]      try:
62          return f[0]
63        except IndexError:
64          return None
65    
66    # write Schema to Database    # write Schema to Database
67    def write(self,obj,overwrite=0):    def write(self,obj,overwrite=0):
68      tmsg = _("This database adapter doesn't have 'schema writing' support")      tmsg = _("This database adapter doesn't have 'schema writing' support")
69      raise NoWriteSchemaSupport, tmsg      raise Exceptions.NoWriteSchemaSupport, tmsg
70    
71    
72    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26