[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common/src GConnections.py GDataObjec...
From: |
Jason Cater |
Subject: |
gnue/gnue-common/src GConnections.py GDataObjec... |
Date: |
Wed, 12 Sep 2001 15:03:05 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/09/12 15:03:05
Modified files:
gnue-common/src: GConnections.py GDataObjects.py
gnue-common/src/dbdrivers/_dbsig: DBdriver.py
gnue-common/src/dbdrivers/postgresql: DBdriver.py
Log message:
synching machines (might break cvs)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConnections.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GDataObjects.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/GConnections.py
diff -u gnue/gnue-common/src/GConnections.py:1.12
gnue/gnue-common/src/GConnections.py:1.13
--- gnue/gnue-common/src/GConnections.py:1.12 Mon Sep 3 23:11:08 2001
+++ gnue/gnue-common/src/GConnections.py Wed Sep 12 15:03:04 2001
@@ -55,17 +55,6 @@
self._loginHandler = loginHandler
self._parser = GConfigParser()
-## #
-## # This is an ugly hack to make the Python 1.5.2 ConfigParser
-## # support reading its data from a file handle. Later versions
-## # have a readfp method. :(
-## #
-## if (not ConfigParser.__dict__.has_key('readfp') and
-## ConfigParser.__dict__.has_key('_ConfigParser__read')):
-## GDebug.printMesg(1,'Subclassing ConfigParser to support URL''s')
-## self._parser = _ConfigParser()
-## else:
-## self._parser = ConfigParser()
GDebug.printMesg(1,'Conn File: "%s"' % location)
Index: gnue/gnue-common/src/GDataObjects.py
diff -u gnue/gnue-common/src/GDataObjects.py:1.17
gnue/gnue-common/src/GDataObjects.py:1.18
--- gnue/gnue-common/src/GDataObjects.py:1.17 Mon Sep 10 18:01:14 2001
+++ gnue/gnue-common/src/GDataObjects.py Wed Sep 12 15:03:04 2001
@@ -204,6 +204,8 @@
#
# Return a list of the types of Schema objects this driver provides
+ # Contains tuples of (key, description, dataSource??)
+ # dataSource?? is true if this schema type can be a datasource
def getSchemaTypes(self):
return []
@@ -591,9 +593,11 @@
# Used to store schema data
class Schema:
- pass
-
-
+ def __init__(self, id=None, name=None, type=None, readOnly = 0)
+ self.id = id
+ self.name = name
+ self.type = type
+ self.readOnly = readOnly
Index: gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.16
gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.17
--- gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.16 Fri Sep 7
11:53:57 2001
+++ gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py Wed Sep 12 15:03:05 2001
@@ -180,7 +180,6 @@
self._fieldNames = []
for t in (self._cursor.description):
self._fieldNames.append (string.lower(t[0]))
-# self._boundFields[string.lower(t[0])] = ""
if rs:
i = 0
dict = {}
Index: gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.12
gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.13
--- gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.12 Sun Sep 9
19:24:04 2001
+++ gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py Wed Sep 12
15:03:05 2001
@@ -16,7 +16,7 @@
# 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:
# postgresql/DBdriver.py
@@ -112,6 +112,47 @@
def _postConnect(self):
self.triggerExtensions = TriggerExtensions(self._dataConnection)
+
+
+ #
+ # Schema (metadata) functions
+ #
+
+ # 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):
+ includeTables = (type in ('table','sources', None))
+ includeViews = (type in ('view','sources', None))
+
+ inClause = []
+ if includeTables:
+ inClause.append ("'r'")
+ if includeViews:
+ inClause.append ("'v'")
+
+ statement = 'select relname from pg_class ' +
+ 'where reltype in (%s) order by relname' % \
+ (string.join(inClause,',')
+
+ cursor = _dataConnection.cursor()
+ cursor.execute(statement)
+
+ list = []
+ for rs in cursor.fetchall():
+ list.append(GDataObjects.Schema(id=string.lower(rs[0]), name=rs[0],
+ type=rs[1] == 'v' and 'view' or 'table'))
+
+ cursor.close()
+ return list
+
+
+ # Find a schema object with specified name
+ def getSchemaByName(self, name, type=None):
+ return None
+
class PG_DataObject_Object(PG_DataObject, \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnue-common/src GConnections.py GDataObjec...,
Jason Cater <=