[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue gnue-common/src/GDataObjects.py gnue-commo...
From: |
James Thompson |
Subject: |
gnue gnue-common/src/GDataObjects.py gnue-commo... |
Date: |
Wed, 18 Jul 2001 16:40:12 -0700 |
CVSROOT: /cvs
Module name: gnue
Branch: gnuef-new-datasources
Changes by: James Thompson <address@hidden> 01/07/18 16:40:12
Modified files:
gnue-common/src: GDataObjects.py
gnue-common/src/dbdrivers/geas: DBdriver.py
gnuef/src : GFForm.py GFInstance.py GFParser.py
GFTrigger.py
gnuef/src/GFObjects: GFBlock.py GFBox.py GFButton.py GFEntry.py
GFLabel.py GFMsgBox.py GFObj.py GFOption.py
GFOptions.py GFPage.py GFScrollBar.py
GFValue.py
Log message:
merged trunk, from gnuef-new-datasources-1 to HEAD
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GDataObjects.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.7&tr2=1.7.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/geas/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.5.2.1&tr2=1.5.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFForm.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.110.2.3&tr2=1.110.2.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFInstance.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.16.2.3&tr2=1.16.2.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFParser.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.46.2.1&tr2=1.46.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFTrigger.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.40.2.1&tr2=1.40.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFBlock.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.4.2.2&tr2=1.4.2.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFBox.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFButton.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFEntry.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.2.2.1&tr2=1.2.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFLabel.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFMsgBox.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFObj.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.2&tr2=1.2.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFOption.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.2&tr2=1.2.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFOptions.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFPage.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFScrollBar.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFValue.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1&tr2=1.1.2.1&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/GDataObjects.py
diff -u gnue/gnue-common/src/GDataObjects.py:1.6
gnue/gnue-common/src/GDataObjects.py:1.7
--- gnue/gnue-common/src/GDataObjects.py:1.6 Tue May 29 19:54:11 2001
+++ gnue/gnue-common/src/GDataObjects.py Tue Jun 5 08:57:45 2001
@@ -127,8 +127,8 @@
criteria = {}
for i in range(0, len(self._masterfields)):
GDebug.printMesg(10,"Adding criteria")
- criteria[string.trim(self._detailfields[i])] = \
- master.current.getField(string.trim(self._masterfields[i]))
+ criteria[string.strip(self._detailfields[i])] = \
+ master.current.getField(string.strip(self._masterfields[i]))
GDebug.printMesg(10,master.current.getField(self._masterfields[i]))
return self.createResultSet(criteria)
Index: gnue/gnue-common/src/dbdrivers/geas/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.5
gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.6
--- gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.5 Wed Jun 27 18:58:51 2001
+++ gnue/gnue-common/src/dbdrivers/geas/DBdriver.py Thu Jul 12 20:56:31 2001
@@ -21,7 +21,7 @@
#
# GEAS database driver
#
-# $Id: DBdriver.py,v 1.5 2001/06/28 01:58:51 jamest Exp $
+# $Id: DBdriver.py,v 1.6 2001/07/13 03:56:31 jcater Exp $
#
import sys
@@ -82,6 +82,7 @@
## Now make connection
#self.database.connect()
+ self.triggerExtensions = TriggerExtensions(self.database)
except (GEAS.ServerError,
GEAS.AuthenticationError),ex:
print "Failed to connect to database. Exiting."
@@ -253,3 +254,29 @@
i = ord(c)
r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
return r
+
+
+
+#
+# Extensions to Trigger Namespaces
+#
+class TriggerExtensions:
+
+ def __init__(self, connection):
+ self.__connection = connection
+
+ # Return the current date, according to database
+# def getDate(self):
+# pass
+
+ # Return a sequence number from sequence 'name'
+# def getSequence(self, name):
+# pass
+
+ # Run the SQL statement 'statement'
+# def sql(self, statement):
+# pass
+
+
+
+
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.112 gnue/gnuef/src/GFForm.py:1.113
--- gnue/gnuef/src/GFForm.py:1.112 Thu Jul 12 20:56:13 2001
+++ gnue/gnuef/src/GFForm.py Mon Jul 16 20:09:41 2001
@@ -783,6 +783,16 @@
return message
self._currentBlock.nextRecord()
+ def jumpRecord(self,count):
+ for block in self._blockList:
+ if hasattr(block,'master'):
+ masterBlock,masterField = string.split(block.master,'.')
+ if masterBlock == self._currentBlock.name:
+ if not block.isSaved():
+ message = GConfig.get('_msgNOTSAVED')
+ return message
+ self._currentBlock.jumpRecord(count)
+
def toggleInsertMode(self):
self._insertMode = not self._insertMode
Index: gnue/gnuef/src/GFInstance.py
diff -u gnue/gnuef/src/GFInstance.py:1.17 gnue/gnuef/src/GFInstance.py:1.18
--- gnue/gnuef/src/GFInstance.py:1.17 Thu Jul 12 20:56:13 2001
+++ gnue/gnuef/src/GFInstance.py Mon Jul 16 20:09:41 2001
@@ -34,7 +34,7 @@
#
# Copyright (c) 2000 Free Software Foundation
#
-# $Id: GFInstance.py,v 1.17 2001/07/13 03:56:13 jcater Exp $
+# $Id: GFInstance.py,v 1.18 2001/07/17 03:09:41 jamest Exp $
#
import pstats
@@ -72,7 +72,7 @@
'requestPREVBLOCK' : self.previousBlock,
'requestPREVRECORD' : self.prevRecord,
'requestNEXTRECORD' : self.nextRecord,
- 'requestJUMPRECORD' : self.jumpRecords,
+ 'requestRECORDNUMBER' : self.jumpRecords,
'requestPAGE' : self.gotoPage,
'requestKEYPRESS' : self.keyPress,
@@ -225,12 +225,18 @@
# form move an arbitrary number of records
#
def jumpRecords(self,event):
- count = event.data
- for jumps in range(abs(count)):
- if count > 0:
- self._form.nextRecord()
- if count < 0:
- self._form.prevRecord()
+ try:
+ count = abs(int(event.data))-1
+ except ValueError:
+ message = "Invalid numeric value entered."
+ else:
+ message = self._form.jumpRecord(count)
+
+ if message:
+ messageBox = GFMsgBox(self,message)
+ messageBox.show()
+ return
+
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
self.updateRecordCounter()
self.updateRecordStatus()
Index: gnue/gnuef/src/GFObjects/GFBlock.py
diff -u gnue/gnuef/src/GFObjects/GFBlock.py:1.5
gnue/gnuef/src/GFObjects/GFBlock.py:1.6
--- gnue/gnuef/src/GFObjects/GFBlock.py:1.5 Mon Jul 16 20:09:41 2001
+++ gnue/gnuef/src/GFObjects/GFBlock.py Wed Jul 18 15:45:01 2001
@@ -31,8 +31,7 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
+#from gnue.common.GObjects import *
from gnue.forms.GFEvent import *
from gnue.forms.GFObjects.GFDataSource import GFDataSource
@@ -41,7 +40,6 @@
from GFObj import GFObj
import string
-import types
# These should really go somewhere else
TRUE = 1
Index: gnue/gnuef/src/GFObjects/GFBox.py
diff -u gnue/gnuef/src/GFObjects/GFBox.py:1.1
gnue/gnuef/src/GFObjects/GFBox.py:1.2
--- gnue/gnuef/src/GFObjects/GFBox.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFBox.py Wed Jul 18 15:45:01 2001
@@ -31,21 +31,8 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
-
-from gnue.common import GDebug
-from gnue.common import GConfig
from GFObj import GFObj
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
-
#
# GFBox
#
@@ -54,6 +41,11 @@
GFObj.__init__(self, parent)
self._type = "GFBox"
self.label = ""
+
+
+
+
+
Index: gnue/gnuef/src/GFObjects/GFButton.py
diff -u gnue/gnuef/src/GFObjects/GFButton.py:1.1
gnue/gnuef/src/GFObjects/GFButton.py:1.2
--- gnue/gnuef/src/GFObjects/GFButton.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFButton.py Wed Jul 18 15:45:01 2001
@@ -30,20 +30,7 @@
# HISTORY:
# Copyright (c) 2000 Free Software Foundation
#
-
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
from GFObj import GFObj
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
#
# GFButton
Index: gnue/gnuef/src/GFObjects/GFEntry.py
diff -u gnue/gnuef/src/GFObjects/GFEntry.py:1.5
gnue/gnuef/src/GFObjects/GFEntry.py:1.6
--- gnue/gnuef/src/GFObjects/GFEntry.py:1.5 Mon Jul 16 20:09:41 2001
+++ gnue/gnuef/src/GFObjects/GFEntry.py Wed Jul 18 15:45:01 2001
@@ -31,18 +31,10 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
-
from gnue.common import GDebug
from gnue.common import GConfig
from GFValue import GFValue
import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
############################################################
# GFEntry
Index: gnue/gnuef/src/GFObjects/GFLabel.py
diff -u gnue/gnuef/src/GFObjects/GFLabel.py:1.2
gnue/gnuef/src/GFObjects/GFLabel.py:1.3
--- gnue/gnuef/src/GFObjects/GFLabel.py:1.2 Mon Jul 16 20:09:41 2001
+++ gnue/gnuef/src/GFObjects/GFLabel.py Wed Jul 18 15:45:01 2001
@@ -31,21 +31,9 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
-
-from gnue.common import GDebug
from gnue.common import GConfig
from GFValue import GFValue
-import string
-import types
-
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
#
#GFLabel
#
@@ -59,7 +47,6 @@
def setValue(self, value):
if not self._value:
GFValue.setValue(self,value)
-
def initialize(self):
self._block = self.findParentOfType('GFBlock')
Index: gnue/gnuef/src/GFObjects/GFMsgBox.py
diff -u gnue/gnuef/src/GFObjects/GFMsgBox.py:1.1
gnue/gnuef/src/GFObjects/GFMsgBox.py:1.2
--- gnue/gnuef/src/GFObjects/GFMsgBox.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFMsgBox.py Wed Jul 18 15:45:01 2001
@@ -31,20 +31,7 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
from gnue.forms.GFEvent import *
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
############################################################
# GFMsgBox
Index: gnue/gnuef/src/GFObjects/GFObj.py
diff -u gnue/gnuef/src/GFObjects/GFObj.py:1.2
gnue/gnuef/src/GFObjects/GFObj.py:1.3
--- gnue/gnuef/src/GFObjects/GFObj.py:1.2 Tue Jul 3 17:54:41 2001
+++ gnue/gnuef/src/GFObjects/GFObj.py Wed Jul 18 15:45:01 2001
@@ -31,17 +31,9 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common import GDebug
-from gnue.common import GConfig
-from gnue.common.GObjects import *
-
+from gnue.common.GObjects import GObj
from gnue.forms.GFTrigger import GFTriggerAware
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
#
# Class GFObj
#
@@ -57,7 +49,6 @@
self._visibleIndex = 0
self.name = "__%s__" % self
-
#
# get an Option
#
@@ -70,7 +61,6 @@
if o.name == name:
option = o.value
return option
-
#
# recalculateVisible
Index: gnue/gnuef/src/GFObjects/GFOption.py
diff -u gnue/gnuef/src/GFObjects/GFOption.py:1.2
gnue/gnuef/src/GFObjects/GFOption.py:1.3
--- gnue/gnuef/src/GFObjects/GFOption.py:1.2 Tue Jul 3 17:54:41 2001
+++ gnue/gnuef/src/GFObjects/GFOption.py Wed Jul 18 15:45:01 2001
@@ -32,17 +32,6 @@
#
from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
# GFOption
#
Index: gnue/gnuef/src/GFObjects/GFOptions.py
diff -u gnue/gnuef/src/GFObjects/GFOptions.py:1.1
gnue/gnuef/src/GFObjects/GFOptions.py:1.2
--- gnue/gnuef/src/GFObjects/GFOptions.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFOptions.py Wed Jul 18 15:45:01 2001
@@ -32,17 +32,6 @@
#
from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
#
# GFOptions
Index: gnue/gnuef/src/GFObjects/GFPage.py
diff -u gnue/gnuef/src/GFObjects/GFPage.py:1.1
gnue/gnuef/src/GFObjects/GFPage.py:1.2
--- gnue/gnuef/src/GFObjects/GFPage.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFPage.py Wed Jul 18 15:45:01 2001
@@ -30,20 +30,7 @@
# HISTORY:
# Copyright (c) 2000 Free Software Foundation
#
-
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
from GFObj import GFObj
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
#
# GFPage
Index: gnue/gnuef/src/GFObjects/GFScrollBar.py
diff -u gnue/gnuef/src/GFObjects/GFScrollBar.py:1.1
gnue/gnuef/src/GFObjects/GFScrollBar.py:1.2
--- gnue/gnuef/src/GFObjects/GFScrollBar.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFScrollBar.py Wed Jul 18 15:45:01 2001
@@ -31,19 +31,7 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
from GFObj import GFObj
-
-from gnue.common import GDebug
-from gnue.common import GConfig
-
-import string
-import types
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
#
# GFScrollBar
Index: gnue/gnuef/src/GFObjects/GFValue.py
diff -u gnue/gnuef/src/GFObjects/GFValue.py:1.1
gnue/gnuef/src/GFObjects/GFValue.py:1.2
--- gnue/gnuef/src/GFObjects/GFValue.py:1.1 Fri Jun 29 15:55:58 2001
+++ gnue/gnuef/src/GFObjects/GFValue.py Wed Jul 18 15:45:01 2001
@@ -31,21 +31,10 @@
# Copyright (c) 2000 Free Software Foundation
#
-from gnue.common.GObjects import *
-from gnue.common.dbdrivers.factory import factory
from GFObj import GFObj
from gnue.common import GDebug
-from gnue.common import GConfig
-import string
-import types
-
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
#
# GFValue
#
@@ -64,6 +53,11 @@
def getValue(self):
GDebug.printMesg(10, "Value = %s"% self._value)
return self._value
+
+
+
+
+
Index: gnue/gnuef/src/GFParser.py
diff -u gnue/gnuef/src/GFParser.py:1.48 gnue/gnuef/src/GFParser.py:1.49
--- gnue/gnuef/src/GFParser.py:1.48 Mon Jul 16 20:09:41 2001
+++ gnue/gnuef/src/GFParser.py Wed Jul 18 15:45:01 2001
@@ -31,7 +31,6 @@
from gnue.common import GDataSource, GParser
import copy, types
-#from gnue.common.GTypecast import *
from gnue.common import GTypecast
Index: gnue/gnuef/src/GFTrigger.py
diff -u gnue/gnuef/src/GFTrigger.py:1.41 gnue/gnuef/src/GFTrigger.py:1.42
--- gnue/gnuef/src/GFTrigger.py:1.41 Thu Jul 12 20:56:13 2001
+++ gnue/gnuef/src/GFTrigger.py Wed Jul 18 15:45:01 2001
@@ -29,7 +29,6 @@
#
import sys
-#from GFObjects import *
from GFEvent import *
from GFTriggerError import *
from gnue.common.GParser import GContent
- gnue gnue-common/src/GDataObjects.py gnue-commo...,
James Thompson <=