[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef setup.py client/gfclient src/drivers...
From: |
James Thompson |
Subject: |
gnue/gnuef setup.py client/gfclient src/drivers... |
Date: |
Wed, 07 Feb 2001 19:11:43 -0800 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 01/02/07 19:11:43
Modified files:
gnuef : setup.py
gnuef/client : gfclient
gnuef/src/drivers/mysql: DBdriver.py
gnuef/src/drivers/odbc: DBdriver.py
Log message:
setup.py only checks during a build
Untested changes to fix odbc and mysql drivers error checking
Changes gfclient to handle full path symbolic links to forms
CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/setup.py.diff?r1=1.9&r2=1.10
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/client/gfclient.diff?r1=1.16&r2=1.17
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/drivers/mysql/DBdriver.py.diff?r1=1.6&r2=1.7
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/drivers/odbc/DBdriver.py.diff?r1=1.2&r2=1.3
Patches:
Index: gnue/gnuef/client/gfclient
diff -u gnue/gnuef/client/gfclient:1.16 gnue/gnuef/client/gfclient:1.17
--- gnue/gnuef/client/gfclient:1.16 Wed Jan 24 19:13:19 2001
+++ gnue/gnuef/client/gfclient Wed Feb 7 19:11:43 2001
@@ -14,6 +14,7 @@
#
import pstats
import os
+import os.path
import sys
import urllib
import gnue.forms.GFOptions
@@ -67,16 +68,22 @@
sys.exit()
else:
if sys.argv[0] != 'gfclient':
- self.formfile = GFOptions.FormDir+"/"+sys.argv[0]+".gfd"
+ self.formfile =
GFOptions.FormDir+"/"+os.path.basename(sys.argv[0])+".gfd"
else:
print "No Forms Definition File Specified. Use GFClient -h for more
information."
sys.exit()
+ # Make sure the form file is a proper url
+
+
+
+
# get the form file handler
try:
fp = urllib.urlopen(self.formfile)
except:
- print "The file %s doesn't seem to exist." % (self.formfile)
+ print "The file %s doesn't seem to exist.\n%s\n%s" % (self.formfile,
sys.exc_info()[0], sys.exc_info()[1])
+
sys.exit()
# Initialize user interface (defaults to gui)
Index: gnue/gnuef/setup.py
diff -u gnue/gnuef/setup.py:1.9 gnue/gnuef/setup.py:1.10
--- gnue/gnuef/setup.py:1.9 Mon Jan 29 13:35:26 2001
+++ gnue/gnuef/setup.py Wed Feb 7 19:11:43 2001
@@ -3,6 +3,7 @@
import string
import os.path
+
try:
from distutils.core import setup
from setupext import Data_Files, install_Data_Files
@@ -11,17 +12,17 @@
Setup requires that python's distutils be
installed. You can get a copy of it from
http://www.python.org/sigs/distutils-sig/
-
-"""
+ """
sys.exit()
-# Verify that our python base is installed
-try:
- print "Checking for GNUe Python Base....",
- import gnue
- print "OK"
-except ImportError:
- print """
+if 'build' in sys.argv:
+ # Verify that our python base is installed
+ try:
+ print "Checking for GNUe Python Base....",
+ import gnue
+ print "OK"
+ except ImportError:
+ print """
You will need to install our base
python package before gnuef will
function properly. You can obtain
@@ -29,65 +30,65 @@
http://gnue.org/index.cgi/downloads
"""
- sys.exit()
+ sys.exit()
-# Verify that PyXML is installed
-try:
- print "Checking for PyXML....",
- from xml.sax import saxexts
- from xml.sax import saxlib
- print "OK"
-except ImportError:
- print """
+ # Verify that PyXML is installed
+ try:
+ print "Checking for PyXML....",
+ from xml.sax import saxexts
+ from xml.sax import saxlib
+ print "OK"
+ except ImportError:
+ print """
Your system does not appear to have the
PyXML module installed. GNUe Forms will
not function without it. It is available
at http://sourceforge.net/projects/pyxml
"""
- sys.exit()
-
-#
-# Verify at least one UI is installed
-#
-UIOK = 0
-
-print "Checking for avalable UI drivers...."
-# PyNcurses
-try:
- print " Pyncurses....",
- import ncurses.form
- print "OK"
- UIOK = 1
-except ImportError:
- print "No"
-
-# Curses
-try:
- print " Curses....",
- import curses
- print "OK"
- UIOK = 1
-except ImportError:
- print "No"
+ sys.exit()
-# wxPython
-try:
- print " wxPython....",
- from wxPython.wx import *
- print "OK"
- UIOK = 1
-except ImportError:
- print "No"
+ #
+ # Verify at least one UI is installed
+ #
+ UIOK = 0
+
+ print "Checking for avalable UI drivers...."
+ # PyNcurses
+ try:
+ print " Pyncurses....",
+ import ncurses.form
+ print "OK"
+ UIOK = 1
+ except ImportError:
+ print "No"
+
+ # Curses
+ try:
+ print " Curses....",
+ import curses
+ print "OK"
+ UIOK = 1
+ except ImportError:
+ print "No"
+
+ # wxPython
+ try:
+ print " wxPython....",
+ from wxPython.wx import *
+ print "OK"
+ UIOK = 1
+ except ImportError:
+ print "No"
-if UIOK != 1:
- print """
+ if UIOK != 1:
+ print """
No valid UI drivers are installed on this machine:
wxPython - www.wxpython.org
pyncurses - pyncurses.sourceforge.net
python curses - Read python install docs on how to activate
"""
- sys.exit()
+ sys.exit()
#
# Verify DB driver of some sort installed
Index: gnue/gnuef/src/drivers/mysql/DBdriver.py
diff -u gnue/gnuef/src/drivers/mysql/DBdriver.py:1.6
gnue/gnuef/src/drivers/mysql/DBdriver.py:1.7
--- gnue/gnuef/src/drivers/mysql/DBdriver.py:1.6 Wed Jan 31 11:16:29 2001
+++ gnue/gnuef/src/drivers/mysql/DBdriver.py Wed Feb 7 19:11:43 2001
@@ -33,33 +33,33 @@
self.connection = MySQLdb.connect(db=dbname, host=dbhost, user=dbuser,
passwd=dbpasswd)
self.connection.cursorclass = MySQLdb.DictCursor
self.cursor = self.connection.cursor()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Connection Error: %s" % (sys.exc_info()[1])
def disconnect(self):
try:
self.connection.close()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Disconnect Error: %s" % (sys.exc_info()[1])
def beginTransaction(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Begin Transaction Error: %s" % (sys.exc_info()[1])
def commit(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Commit Error: %s" % (sys.exc_info()[1])
def rollback(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Rollback Error: %s " % (sys.exc_info()[1])
def insert(self, table, mask):
@@ -70,8 +70,8 @@
command = self.constructSQL('insert', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Insert Error: %s" % (sys.exc_info()[1])
mask[self.uniqueKey] = self.getMaskCount()
return mask
@@ -80,16 +80,16 @@
command = self.constructSQL('delete', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Deletion Error: %s" % (sys.exc_info()[1])
def update(self, table, mask):
command = self.constructSQL('update', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Update Error: %s " % (sys.exc_info()[1])
def getFieldList(self, table):
@@ -98,8 +98,8 @@
cr = self.connection.cursor()
cr.execute('DESCRIBE %s' % table)
rs = cr.fetchallDict()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Field retrieval error"
self.getUniqueKey(table)
for r in rs:
l[r["Field"]] = "text"
@@ -118,8 +118,9 @@
try:
self.cursor.execute(command)
rs = self.cursor.fetchallDict()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Query Error: %s" % (sys.exc_info()[1])
+
self.oldMaskData = {}
self.maskCount = 1
for r in rs:
Index: gnue/gnuef/src/drivers/odbc/DBdriver.py
diff -u gnue/gnuef/src/drivers/odbc/DBdriver.py:1.2
gnue/gnuef/src/drivers/odbc/DBdriver.py:1.3
--- gnue/gnuef/src/drivers/odbc/DBdriver.py:1.2 Wed Jan 31 11:16:29 2001
+++ gnue/gnuef/src/drivers/odbc/DBdriver.py Wed Feb 7 19:11:43 2001
@@ -30,32 +30,32 @@
try:
self.connection = self.driver.DriverConnect(self.dsn)
self.cursor = self.connection.cursor()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def disconnect(self):
try:
self.connection.close()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def beginTransaction(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def commit(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def rollback(self):
try:
pass
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def insert(self, table, mask):
@@ -66,8 +66,8 @@
command = self.constructSQL('insert', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
mask[self.uniqueKey] = self.getMaskCount()
return mask
@@ -75,15 +75,15 @@
command = self.constructSQL('delete', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def update(self, table, mask):
command = self.constructSQL('update', table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
def getFieldList(self, table):
l = {}
@@ -92,8 +92,8 @@
self.cursor.columns(None, None, table, None)
try:
rs = self.cursor.fetchall()
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
self.getUniqueKey(table)
self.fieldlistmap[self.uniqueKey] = 0
@@ -110,8 +110,8 @@
command = self.constructSQL('query',table, mask)
try:
self.cursor.execute(command)
- except Error, value:
- raise DBError, value
+ except:
+ raise DBError, "Database Error: %s" % (sys.exc_info()[1])
rs = self.cursor.fetchall()
self.oldMaskData = {}
self.maskCount = 1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnuef setup.py client/gfclient src/drivers...,
James Thompson <=