[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-common/src/datasources GIntrospection.py
From: |
Jason Cater |
Subject: |
gnue-common/src/datasources GIntrospection.py |
Date: |
Tue, 25 Nov 2003 14:53:13 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue-common
Branch:
Changes by: Jason Cater <address@hidden> 03/11/25 14:53:13
Modified files:
src/datasources: GIntrospection.py
Log message:
Renamed findfirst to findone, to mirror wordage used elsewhere
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/datasources/GIntrospection.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gnue-common/src/datasources/GIntrospection.py
diff -c gnue-common/src/datasources/GIntrospection.py:1.3
gnue-common/src/datasources/GIntrospection.py:1.4
*** gnue-common/src/datasources/GIntrospection.py:1.3 Tue Nov 25 14:39:57 2003
--- gnue-common/src/datasources/GIntrospection.py Tue Nov 25 14:53:13 2003
***************
*** 27,33 ****
# Old methods in GDataObjects and their new counterparts:
# * getSchemaTypes() --> types
# * getSchemaList() --> find(type='...')
! # * getSchemaByName() --> find(name='...')
# * writeSchema() --> write()
#
# Preferred way to access these discovery routines is:
--- 27,33 ----
# Old methods in GDataObjects and their new counterparts:
# * getSchemaTypes() --> types
# * getSchemaList() --> find(type='...')
! # * getSchemaByName() --> findone(name='...')
# * writeSchema() --> write()
#
# Preferred way to access these discovery routines is:
***************
*** 36,41 ****
--- 36,42 ----
import string
+ import Exceptions
#
# Schema (metadata) functions
***************
*** 55,69 ****
def find(self, name=None, type=None):
return []
!
! def findfirst(self, *args, **parms):
! return self.find(*args, **parms)[0]
!
# write Schema to Database
def write(self,obj,overwrite=0):
tmsg = _("This database adapter doesn't have 'schema writing' support")
! raise NoWriteSchemaSupport, tmsg
--- 56,72 ----
def find(self, name=None, type=None):
return []
! def findone(self, *args, **parms):
! f = self.find(*args, **parms)
! try:
! return f[0]
! except IndexError:
! return None
# write Schema to Database
def write(self,obj,overwrite=0):
tmsg = _("This database adapter doesn't have 'schema writing' support")
! raise Exceptions.NoWriteSchemaSupport, tmsg