[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue gnue-common/src/GConnections.py gnue-commo...
From: |
Jason Cater |
Subject: |
gnue gnue-common/src/GConnections.py gnue-commo... |
Date: |
Tue, 18 Sep 2001 23:23:21 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/09/18 23:23:20
Modified files:
gnue-common/src: GConnections.py
gnue-common/src/dbdrivers/db2: DBdriver.py
gnue-common/src/dbdrivers/oracle: DBdriver.py
gnue-common/src/dbdrivers/postgresql: DBdriver.py
gnuef/src : GFParser.py
Log message:
Added support for several new dbdrivers (NOTE: not all are tested).
Also, some drivers no longer use dbname= and host= connection parameters, but
now use service= . This is also true of the old DB2 and Oracle drivers as they
want a DSN and TNS Name, respectively.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConnections.py.diff?cvsroot=OldCVS&tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/db2/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFParser.py.diff?cvsroot=OldCVS&tr1=1.53&tr2=1.54&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/GConnections.py
diff -u gnue/gnue-common/src/GConnections.py:1.18
gnue/gnue-common/src/GConnections.py:1.19
--- gnue/gnue-common/src/GConnections.py:1.18 Tue Sep 18 17:10:28 2001
+++ gnue/gnue-common/src/GConnections.py Tue Sep 18 23:23:20 2001
@@ -42,15 +42,20 @@
# exist in the Connections Definition File.
pass
-class InvalidFormatError (StandardError):
- # Raised if the Connections Definition File is
+class AdapterNotAvailable (StandardError):
+ # Raised if a provider is requested for which
+ # the python libraries are not installed.
+ pass
+
+class InvalidFormatError (StandardError):
+ # Raised if the Connections Definition File is
# in an unreadable format.
pass
class GConnections:
- def __init__(self, location, loginHandler=None):
+ def __init__(self, location, loginHandler=None):
self._loginHandler = loginHandler
self._parser = GConfigParser()
Index: gnue/gnue-common/src/dbdrivers/db2/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/db2/DBdriver.py:1.5
gnue/gnue-common/src/dbdrivers/db2/DBdriver.py:1.6
--- gnue/gnue-common/src/dbdrivers/db2/DBdriver.py:1.5 Tue Sep 18 17:58:25 2001
+++ gnue/gnue-common/src/dbdrivers/db2/DBdriver.py Tue Sep 18 23:23:20 2001
@@ -1,19 +1,19 @@
#
-# This file is part of GNU Enterprise.
+# This file is part of GNU Enterprise.
#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
# version 2, or (at your option) any later version.
#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright 2000 Free Software Foundation
@@ -26,12 +26,16 @@
#
# NOTES:
#
+# Supported attributes (via connections.conf or <database> tag)
+#
+# service= This is the DB2 DSN for your connection (required)
+#
import DB2
import string
import sys
-from string import lower
+from string import lower
# from gnue.forms import GFOptions
from gnue.forms.GFError import DBError
from gnue.common import GDebug, GDataObjects
@@ -40,35 +44,35 @@
DBSIG_DataObject_SQL, DBSIG_DataObject_Object
-class DB2_RecordSet(DBSIG_RecordSet):
- def _postChanges(self):
+class DB2_RecordSet(DBSIG_RecordSet):
+ def _postChanges(self):
values = []
fields = []
fieldString = ""
- for field in (self._modifiedFields.keys()):
+ for field in (self._modifiedFields.keys()):
fields.append(field + " = %s")
values.append(self._fields[field])
-
+
statement = 'UPDATE %s SET %s WHERE %s = %s'
-
-class DB2_ResultSet(DBSIG_ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
+
+class DB2_ResultSet(DBSIG_ResultSet):
+ def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
DBSIG_ResultSet.__init__(self, dataObject, \
cursor, defaultValues, masterRecordSet)
self._recordSetClass = DB2_RecordSet
-class DB2_DataObject(DBSIG_DataObject):
- def __init__(self):
+class DB2_DataObject(DBSIG_DataObject):
+ def __init__(self):
DBSIG_DataObject.__init__(self)
self._DatabaseError = "Database Error"
- def connect(self, connectData={}):
+ def connect(self, connectData={}):
GDebug.printMesg(1,"DB2 database driver initializing")
- try:
- self._dataConnection = DB2.connect(uid=connectData['_username'],
- pwd=connectData['_password'],
- dsn=connectData['dbname'])
+ try:
+ self._dataConnection = DB2.connect(uid=connectData['_username'],
+ pwd=connectData['_password'],
+ dsn=connectData['service'])
self.triggerExtensions = TriggerExtensions(self._dataConnection)
except self._DatabaseError, value:
raise GDataObjects.ConnectionError, value
@@ -92,7 +96,7 @@
def __init__(self):
# Call DBSIG init first because DB2_DataObject needs to overwrite
# some of its values
- DBSIG_DataObject_SQL.__init__(self)
+ DBSIG_DataObject_SQL.__init__(self)
DB2_DataObject.__init__(self)
def _buildQuery(self, conditions={}):
Index: gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.6
gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.7
--- gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.6 Wed Aug 29
14:21:22 2001
+++ gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py Tue Sep 18 23:23:20 2001
@@ -16,79 +16,108 @@
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
-# Copyright 2000 Free Software Foundation
+# Copyright 2000, 2001 Free Software Foundation
#
# FILE:
# DBdriver.py
#
# DESCRIPTION:
# Driver to provide access to data via Digital Creations Oracle/Python Driver
-# Accessed via the GFBlock object
-# Requires DCOracle 1.3.x (http://www.zope.org/Products/DCOracle/)
+# Requires DCOracle2 2.x (http://www.zope.org/Products/DCOracle2/)
#
# NOTES:
#
-
-
-
-import DCOracle2
+# Supported attributes (via connections.conf or <database> tag)
+#
+# service= This is the Oracle TNS name for your connection (required)
+#
from string import lower
import sys
-from gnue.common import GDebug, GDataObjects
+from gnue.common import GDebug, GDataObjects, GConnections
from gnue.common.dbdrivers._dbsig.DBdriver \
import DBSIG_RecordSet, DBSIG_ResultSet, DBSIG_DataObject, \
DBSIG_DataObject_SQL, DBSIG_DataObject_Object
+try:
+ import DCOracle2 as SIG2api
+except ImportError, message:
+ raise GConnections.AdapterNotInstalled, \
+ "Driver not installed: cx_Oracle [%s]" % message
-class Oracle_RecordSet(DBSIG_RecordSet):
- pass
-class Oracle_ResultSet(DBSIG_ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
+class Oracle_RecordSet(DBSIG_RecordSet):
+ pass
+
+
+class Oracle_ResultSet(DBSIG_ResultSet):
+ def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
DBSIG_ResultSet.__init__(self, dataObject, \
cursor, defaultValues, masterRecordSet)
self._recordSetClass = Oracle_RecordSet
self._uniqueIdField = "__GNUeF__uniqueKey_%s" % (self._dataObject.table)
- self._uniqueIdFormat = "ROWID='%s'"
+ self._uniqueIdFormat = "ROWID='%s'"
-class Oracle_DataObject(DBSIG_DataObject):
- def __init__(self):
+class Oracle_DataObject(DBSIG_DataObject):
+ def __init__(self):
DBSIG_DataObject.__init__(self)
- self._DatabaseError = DCOracle2.DatabaseError
+ self._DatabaseError = SIG2api.DatabaseError
self._resultSetClass = Oracle_ResultSet
- def connect(self, connectData={}):
+ def connect(self, connectData={}):
GDebug.printMesg(1,"Oracle database driver initializing")
- try:
- self._dataConnection = DCOracle2.connect("%s/address@hidden" \
+ try:
+ self._dataConnection = SIG2api.connect("%s/address@hidden" \
% (connectData['_username'], \
connectData['_password'], \
- connectData['dbname']))
+ connectData['service']))
except self._DatabaseError, value:
raise GDataObjects.ConnectionError, value
self._postConnect()
+
+
+ #
+ # Schema (metadata) functions
+ #
+
+ # TODO: See postgresql for an example of what these functions do.
+
+ # Return a list of the types of Schema objects this driver provides
+ def getSchemaTypes(self):
+ return [('view','View',1), ('table','Table',1)]
+
+ # Return a list of Schema objects
+ def getSchemaList(self, type=None):
+ return []
+
+ # Find a schema object with specified name
+ def getSchemaByName(self, name, type=None):
+ return None
+
+ def _postConnect(self):
+ self.triggerExtensions = TriggerExtensions(self._dataConnection)
+
- def _postConnect(self):
+ def _postConnect(self):
self.triggerExtensions = TriggerExtensions(self._dataConnection)
class Oracle_DataObject_Object(Oracle_DataObject, \
- DBSIG_DataObject_Object):
+ DBSIG_DataObject_Object):
- def __init__(self):
- # Call DBSIG init first because Oracle_DataObject needs to overwrite
+ def __init__(self):
+ # Call DBSIG init first because Oracle_DataObject needs to overwrite
# some of its values
- DBSIG_DataObject_Object.__init__(self)
+ DBSIG_DataObject_Object.__init__(self)
Oracle_DataObject.__init__(self)
- def _buildQuery(self, conditions={}):
+ def _buildQuery(self, conditions={}):
return DBSIG_DataObject_Object._buildQuery(self, conditions)
@@ -150,276 +179,3 @@
-
-##########################################################################
-##########################################################################
-##
-## The following is the old-style (pre-GDataObject/GDataSource) driver
-## code. It will soon be deleted after GForms is converted to new style.
-##
-##########################################################################
-##########################################################################
-
-
-import DCOracle
-import sys
-from string import split, upper, lower, join, replace
-from gnue.forms import GFDebug
-from gnue.forms.GFError import DBError
-
-class DBdriver:
- def __init__(self):
- GFDebug.printMesg(8,"Oracle 7.3/8.x database driver (OCI)
initializing...")
- self.connection = None
- self.cursor = None
- self.uniqueKey = None
- self.oldMaskData = {}
- self.maskCount = 1
-
- def connect(self, dbhost, dbname, dbuser, dbpasswd):
- GFDebug.printMesg(10,"Oracle DBdriver: Connect String: "
- + dbuser + "/" + dbpasswd + "@" + dbname)
- self.connectWithString (dbuser + "/" + dbpasswd + "@" + dbname)
- self.triggerExtensions = TriggerExtensions(self.connection)
-
- def connectWithString(self, dbConnectString):
- try:
- self.connection = DCOracle.Connect(dbConnectString)
- self.cursor = self.connection.cursor()
- except:
- raise DBError, "Connection Error: %s" % (sys.exc_info()[1])
-
- def disconnect(self):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to disconnect")
- try:
- self.connection.close()
- except:
- raise DBError, "Disconnect Error: %s" % (sys.exc_info()[1])
-
-
- def beginTransaction(self):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to begin a transaction")
- try:
- # Oracle is transactional by default, so we'll do nothing
- pass
- except:
- raise DBError, "Begin Transaction Error: %s" % (sys.exc_info()[1])
-
- def commit(self):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to commit")
- try:
- self.connection.commit()
- except:
- raise DBError, "Commit Error: %s" % (sys.exc_info()[1])
-
- def rollback(self):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to rollback")
- try:
- self.connection.rollback()
- except:
- raise DBError, "Rollback Error: %s " % (sys.exc_info()[1])
-
-
- def insert(self, table, mask):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to insert")
- for fieldname in mask.keys():
- if mask[fieldname] == None or len(mask[fieldname]) == 0:
- del mask[fieldname]
-
- command = self.constructSQL('insert', table, mask)
- GFDebug.printMesg(8,"Oracle DBdriver: insert statement: " + command)
- try:
- self.cursor.execute(command)
- except:
- raise DBError, "Insert Error: %s" % (sys.exc_info()[1])
-
- mask[self.uniqueKey] = self.getMaskCount()
- return mask
-
- def delete(self, table, mask):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to delete")
- command = self.constructSQL('delete', table, mask)
- try:
- self.cursor.execute(command)
- except:
- raise DBError, "Deletion Error: %s" % (sys.exc_info()[1])
-
-
- def update(self, table, mask):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to update")
- command = self.constructSQL('update', table, mask)
- GFDebug.printMesg(8,"Oracle DBdriver: update statement: " + command)
- try:
- self.cursor.execute(command)
- except:
- raise DBError, "Update Error: %s " % (sys.exc_info()[1])
-
-
- def getFieldList(self, table):
- l = {}
-
- try:
- cr = self.connection.cursor()
- cr.execute("select * from %s where 1 = 2" % table)
- rs = cr.description
- except:
- raise DBError, "Field retrieval error ('%s' does not exist or is not
accessible)" % table
-
- self.getUniqueKey(table)
- for r in rs:
- l[lower(r[0])] = "text"
- return l
-
-
- def query(self, table, mask, order_by = None, readOnly = 0):
- GFDebug.printMesg(8,"Oracle DBdriver: I was asked to query")
-
- # This is probably very inefficient, but let's determine if we can access
ROWID.
- # If not, then this "table" must be a read only view or such and we will
not be able
- # to update any records (query only form!)
- if readOnly:
- self.cursor.isUpdatable = 0
- else:
- try:
- command = "select rowidtochar(rowid) from %s where 1=2" % table
- self.cursor.execute(command)
- self.cursor.isUpdatable = 1
- mask["ROWIDTOCHAR(ROWID) as GNUEF_ROWID"] = ""
- maskCount = maskCount + 1
- GFDebug.printMesg(8,"Oracle DBdriver: table %s has virtual ROWID
field" % table)
- except:
- self.cursor.isUpdatable = 0
- GFDebug.printMesg(8,"Oracle DBdriver: view %s does NOT have virtual
ROWID field" % table)
-
- command = self.constructSQL('query',table, mask)
- GFDebug.printMesg(8,"Oracle DBdriver: query statement: " + command)
- unq = self.getUniqueKey(table)
- try:
- self.cursor.execute(command)
- cols = []
- for r in self.cursor.description:
- if r[0] == 'GNUEF_ROWID':
- cols.append(unq)
- else:
- cols.append(lower(r[0]))
- except:
- raise DBError, "Query Error: %s" % (sys.exc_info()[1])
-
- maskCount = len (cols)
- rs = []
- for r in self.cursor.fetchall():
- rs.append ({})
- for i in range(0, maskCount):
- rs[-1][cols[i]] = r[i]
-
- return rs
-
-
-
- def constructSQL(self, style, table, mask = None):
- sql = None
- fields = None
- qualifier = None
-
- if style == 'query':
- action = "SELECT "
- location = "FROM %s " % (table)
- fields = " * "
-
- if type(mask) == type({}):
- fields = "%s" % (join(mask.keys(), ','))
- fields = replace(fields, "%s," % (self.uniqueKey), '')
- fields = "%s " % (fields)
- for fieldname in mask.keys():
- if fieldname != self.uniqueKey:
- if mask[fieldname] != None and len(mask[fieldname]):
- if qualifier == None:
- qualifier = "WHERE %s LIKE '%s'" % (fieldname,mask[fieldname])
- else:
- qualifier = "%s AND %s LIKE '%s'" % (qualifier,
fieldname,mask[fieldname])
-
- sql = action + fields + location + (qualifier and qualifier or "")
-
- elif style == 'insert':
- action = "INSERT "
- location = "INTO %s " % (table)
- values = None
-
- if type(mask) == type({}):
- fields = "(%s) " % (join(mask.keys(), ','))
- for fieldname in mask.keys():
- if fieldname != self.uniqueKey:
- if mask[fieldname] != None and len(mask[fieldname]):
- if values == None:
- values = "VALUES ('%s'" % (mask[fieldname])
- else:
- values = "%s, '%s'" % (values, mask[fieldname])
- values = "%s)" % (values)
-
- sql = action + location + fields + values + (qualifier and qualifier or
"")
-
- elif style == 'update':
- action = "UPDATE "
- location = "%s " % (table)
- values = " SET "
- qualifier = " WHERE "
-
- if type(mask) == type({}):
- for fieldname in mask.keys():
- if fieldname != self.uniqueKey:
- if mask[fieldname] != None and len(mask[fieldname]):
- values = "%s %s='%s'," % (values, fieldname, mask[fieldname])
- qualifier = "%s ROWID='%s'" % (qualifier, mask[self.uniqueKey])
- values = values[:-1]
-
- sql = action + location + values + (qualifier and qualifier or "")
-
- elif style == 'delete':
- action = "DELETE FROM "
- location = "%s " % (table)
- values = ""
- qualifier = " WHERE "
-
- if type(mask) == type({}):
- qualifier = "%s ROWID='%s'" % (qualifier, mask[self.uniqueKey])
-
- sql = action + location + values + (qualifier and qualifier or "")
-
- else:
- print "constructSQL: unsupported SQL statement type"
-
- return sql
-
- def getUniqueKey(self, table):
- self.uniqueKey = "__GNUeF__uniqueKey_%s" % (table)
- return self.uniqueKey
-
- def getMaskCount(self):
- self.maskCount = self.maskCount + 1
- return self.maskCount - 1
-
-#
-# Extensions to Trigger Namespaces
-#
-class TriggerExtensions:
-
- def __init__(self, connection):
- self.__connection = connection
-
- # Return the current date, according to database
- def getDate(self):
- cursor = self.__connection.cursor()
- command = "select sysdate from dual"
- cursor.execute(command)
- return cursor.fetchone()[0]
-
- # Return a sequence number from sequence 'name'
- def getSequence(self, name):
- cursor = self.__connection.cursor()
- command = "select %s.nextval from dual" % name
- cursor.execute(command)
- return cursor.fetchone()[0]
-
- # Run the SQL statement 'statement'
- def sql(self, statement):
- self.__connection.cursor().execute(statement)
Index: gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.18
gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.19
--- gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.18 Mon Sep 17
22:47:04 2001
+++ gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py Tue Sep 18
23:23:20 2001
@@ -29,21 +29,28 @@
#
-import pg, pgdb
-
from string import lower, join
import sys
-from gnue.common import GDebug, GDataObjects
+from gnue.common import GDebug, GDataObjects, GConnections
from gnue.common.dbdrivers._dbsig.DBdriver \
import DBSIG_RecordSet, DBSIG_ResultSet, DBSIG_DataObject, \
DBSIG_DataObject_SQL, DBSIG_DataObject_Object
+try:
+ import pg
+ import pgdb as SIG2api
+except ImportError, message:
+ raise GConnections.AdapterNotInstalled, \
+ "Driver not installed: pygresql for PostgreSQL [%s]" % message
+
+
+
-class PG_RecordSet(DBSIG_RecordSet):
- pass
+class PG_RecordSet(DBSIG_RecordSet):
+ pass
class PG_ResultSet(DBSIG_ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
+ def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
DBSIG_ResultSet.__init__(self, dataObject, \
cursor, defaultValues, masterRecordSet)
self._recordSetClass = PG_RecordSet
@@ -52,19 +59,19 @@
#### NOTE: Once PyGreSQL's .fetchone() bug is fixed, this method
#### should be deleted! Also note the line in PG_DataObject.__init__.
#### Right now, we are having to preload *ALL* rows from a datasource.
- def _loadNextRecord(self):
- if self._cursor:
- try:
+ def _loadNextRecord(self):
+ if self._cursor:
+ try:
rsall = self._cursor.fetchall()
except self._dataObject._DatabaseError, err:
raise GDataObjects.ConnectionError, err
- if len(rsall):
+ if len(rsall):
for rs in(rsall):
GDebug.printMesg(5, "New row retrieved: %s" % rs)
- if not self._fieldNames:
+ if not self._fieldNames:
self._fieldNames = []
- for t in(self._cursor.description):
+ for t in(self._cursor.description):
self._fieldNames.append(t[0])
GDebug.printMesg(5, "Field names set to %s" % self._fieldNames)
if rs:
@@ -90,7 +97,7 @@
class PG_DataObject(DBSIG_DataObject):
def __init__(self):
DBSIG_DataObject.__init__(self)
- self._DatabaseError = pgdb.DatabaseError
+ self._DatabaseError = SIG2api.DatabaseError
#### When the PyGreSQL's .fetchone() bug is fixed, delete following line
self._resultSetClass = PG_ResultSet
@@ -98,7 +105,7 @@
def connect(self, connectData={}):
GDebug.printMesg(1,"Postgresql database driver initializing")
try:
- self._dataConnection = pgdb.connect(user=connectData['_username'],
+ self._dataConnection = SIG2api.connect(user=connectData['_username'],
password=connectData['_password'],
host=connectData['host'],
database=connectData['dbname'])
Index: gnue/gnuef/src/GFParser.py
diff -u gnue/gnuef/src/GFParser.py:1.53 gnue/gnuef/src/GFParser.py:1.54
--- gnue/gnuef/src/GFParser.py:1.53 Mon Aug 13 19:15:28 2001
+++ gnue/gnuef/src/GFParser.py Tue Sep 18 23:23:20 2001
@@ -101,53 +101,56 @@
'left': {},
'right': {},
'bottom': {},
- 'top': {} },
- 'Default': "" },
+ 'top': {} },
+ 'Default': "" },
'width': {
- 'Typecast': GTypecast.whole,
+ 'Typecast': GTypecast.whole,
'Default': 40 },
'height': {
- 'Typecast': GTypecast.whole,
+ 'Typecast': GTypecast.whole,
'Default': 12 } },
'ParentTags': None },
- 'import': {
+ 'import': {
'BaseClass': GFLibrary.GFImport,
- 'Attributes': {
+ 'Attributes': {
'library': {
- 'Required': 1,
- 'Typecast': GTypecast.name },
+ 'Required': 1,
+ 'Typecast': GTypecast.name },
'datasources': {
- 'Typecast': GTypecast.name,
- 'Default': "" },
+ 'Typecast': GTypecast.name,
+ 'Default': "" },
'pages': {
- 'Typecast': GTypecast.name,
- 'Default': "" },
+ 'Typecast': GTypecast.name,
+ 'Default': "" },
'triggers': {
- 'Typecast': GTypecast.name,
- 'Default': "" } },
+ 'Typecast': GTypecast.name,
+ 'Default': "" } },
'ParentTags': ('form',) },
- 'database': {
- 'BaseClass': GFObjects.GFDatabase,
- 'Attributes': {
+ 'database': {
+ 'BaseClass': GFObjects.GFDatabase,
+ 'Attributes': {
'name': {
- 'Required': 1,
- 'Unique': 1,
- 'Typecast': GTypecast.name },
+ 'Required': 1,
+ 'Unique': 1,
+ 'Typecast': GTypecast.name },
'provider': {
- 'Required': 1,
- 'Typecast': GTypecast.name },
+ 'Required': 1,
+ 'Typecast': GTypecast.name },
'dbname': {
- 'Required': 1,
- 'Typecast': GTypecast.text },
+ 'Required': 0,
+ 'Typecast': GTypecast.text },
+ 'service': {
+ 'Required': 0,
+ 'Typecast': GTypecast.text },
'comment': {
- 'Required': 0,
- 'Typecast': GTypecast.text },
+ 'Required': 0,
+ 'Typecast': GTypecast.text },
'host': {
- 'Required': 1,
- 'Typecast': GTypecast.text } },
- 'Deprecated': 'Use the external connections file format.',
+ 'Required': 0,
+ 'Typecast': GTypecast.text } },
+ 'Deprecated': 'Use the external connections file format.',
'ParentTags': ('form',) },
'datasource': {
@@ -169,7 +172,7 @@
'name': {
'Required': 1,
'Unique': 1,
- 'Typecast': GTypecast.name },
+ 'Typecast': GTypecast.name },
'master': {
'References': (('datasource','name'),),
'Typecast': GTypecast.name },