[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/appserver/src geasInstance.py geasList.py ...
From: |
Reinhard Mueller |
Subject: |
gnue/appserver/src geasInstance.py geasList.py ... |
Date: |
Sun, 26 May 2002 17:15:30 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Reinhard Mueller <address@hidden> 02/05/26 17:15:29
Modified files:
appserver/src : geasInstance.py geasList.py geasSession.py
test.py
Log message:
Added some comments and minor code cleanups.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasInstance.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasList.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/test.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: gnue/appserver/src/geasInstance.py
diff -c gnue/appserver/src/geasInstance.py:1.4
gnue/appserver/src/geasInstance.py:1.5
*** gnue/appserver/src/geasInstance.py:1.4 Sun May 26 05:22:15 2002
--- gnue/appserver/src/geasInstance.py Sun May 26 17:15:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasInstance.py,v 1.4 2002/05/26 09:22:15 siesel Exp $
#
=============================================================================
# Instance class
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasInstance.py,v 1.5 2002/05/26 21:15:29 reinhard Exp $
#
=============================================================================
# Instance class
***************
*** 51,69 ****
def put (self, fieldname, value):
# TODO: translate the field name into a column name
self._record.setField (fieldname, value)
- # self._record.post () # FIXME: Do that here? or elsewhere? later?
- # post() should be called at result set level
#
---------------------------------------------------------------------------
# Call a method
#
---------------------------------------------------------------------------
def call (self, methodname):
pass
-
#
---------------------------------------------------------------------------
! # Delete this instance
#
---------------------------------------------------------------------------
def delete(self):
--- 51,67 ----
def put (self, fieldname, value):
# TODO: translate the field name into a column name
self._record.setField (fieldname, value)
#
---------------------------------------------------------------------------
# Call a method
#
---------------------------------------------------------------------------
def call (self, methodname):
+ # not yet implemented
pass
#
---------------------------------------------------------------------------
! # Delete this instance
#
---------------------------------------------------------------------------
def delete(self):
Index: gnue/appserver/src/geasList.py
diff -c gnue/appserver/src/geasList.py:1.5 gnue/appserver/src/geasList.py:1.6
*** gnue/appserver/src/geasList.py:1.5 Sun May 26 15:36:34 2002
--- gnue/appserver/src/geasList.py Sun May 26 17:15:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.5 2002/05/26 19:36:34 siesel Exp $
from gnue.common import GDataSource
import geasInstance
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.6 2002/05/26 21:15:29 reinhard Exp $
from gnue.common import GDataSource
import geasInstance
***************
*** 73,85 ****
if hasattr(self,"_sort"):
self._datasource.order_by=string.joinfields(self._sort,",")
-
self._datasource.phaseInit ()
# TODO: get the column names from the prefetch field names
for field in self._prefetch:
self._datasource.referenceField (field)
-
self._resultset = self._datasource.createResultSet ()
#
---------------------------------------------------------------------------
--- 73,83 ----
***************
*** 87,93 ****
#
---------------------------------------------------------------------------
def firstInstance (self):
! if self._resultset.firstRecord ()!=0:
return geasInstance.geasInstance (self._classname,
self._resultset.current)
else:
return None
--- 85,91 ----
#
---------------------------------------------------------------------------
def firstInstance (self):
! if self._resultset.firstRecord () != 0:
return geasInstance.geasInstance (self._classname,
self._resultset.current)
else:
return None
***************
*** 97,113 ****
#
---------------------------------------------------------------------------
def nextInstance (self):
! if self._resultset.nextRecord ()!=0:
return geasInstance.geasInstance (self._classname,
self._resultset.current)
else:
return None
-
#
---------------------------------------------------------------------------
# insert a new empty instance in the list and return it
#
---------------------------------------------------------------------------
def insertNewInstance (self):
! self._resultset.insertRecord()
return geasInstance.geasInstance (self._classname,
self._resultset.current)
-
--- 95,109 ----
#
---------------------------------------------------------------------------
def nextInstance (self):
! if self._resultset.nextRecord () != 0:
return geasInstance.geasInstance (self._classname,
self._resultset.current)
else:
return None
#
---------------------------------------------------------------------------
# insert a new empty instance in the list and return it
#
---------------------------------------------------------------------------
def insertNewInstance (self):
! self._resultset.insertRecord ()
return geasInstance.geasInstance (self._classname,
self._resultset.current)
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.5
gnue/appserver/src/geasSession.py:1.6
*** gnue/appserver/src/geasSession.py:1.5 Sun May 26 05:22:15 2002
--- gnue/appserver/src/geasSession.py Sun May 26 17:15:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.5 2002/05/26 09:22:15 siesel Exp $
import geasList
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.6 2002/05/26 21:15:29 reinhard Exp $
import geasList
***************
*** 28,46 ****
--- 28,63 ----
#
=============================================================================
class geasSession:
+
+ #
---------------------------------------------------------------------------
+ # Initalize
+ #
---------------------------------------------------------------------------
+
def __init__ (self, connections):
self.loggedIn = 0
self._connections = connections
self._activelists = []
+ #
---------------------------------------------------------------------------
+ # Log into the application server
+ #
---------------------------------------------------------------------------
+
def login (self, user, password):
# This username/password is for the Application Server, not for the
# database.
self.loggedIn = 1
+ #
---------------------------------------------------------------------------
+ # Logout from the application server
+ #
---------------------------------------------------------------------------
+
def logout (self):
self.loggedIn = 0
+ #
---------------------------------------------------------------------------
+ # Create a new list of business objects of a given class
+ #
---------------------------------------------------------------------------
+
def createList (self, classname):
newlist=geasList.geasList (self, classname)
# every new list will be added to the _activelists list
***************
*** 48,57 ****
--- 65,82 ----
self._activelists.append(newlist)
return newlist;
+ #
---------------------------------------------------------------------------
+ # Commit the active transaction
+ #
---------------------------------------------------------------------------
+
def commit (self):
for l in self._activelists:
l._resultset.post()
l._datasource.commit()
+
+ #
---------------------------------------------------------------------------
+ # Rollback the active transaction
+ #
---------------------------------------------------------------------------
def rollback (self):
for l in self._activelists:
Index: gnue/appserver/src/test.py
diff -c gnue/appserver/src/test.py:1.7 gnue/appserver/src/test.py:1.8
*** gnue/appserver/src/test.py:1.7 Mon May 6 18:32:59 2002
--- gnue/appserver/src/test.py Sun May 26 17:15:29 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test.py,v 1.7 2002/05/06 22:32:59 siesel Exp $
import os
from gnue.common import GClientApp
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test.py,v 1.8 2002/05/26 21:15:29 reinhard Exp $
import os
from gnue.common import GClientApp
***************
*** 33,48 ****
class testApp (GClientApp.GClientApp):
#
---------------------------------------------------------------------------
! # Main program
#
---------------------------------------------------------------------------
! def getSession(self):
# set up login handler
self.connections.setLoginHandler (testLoginHandler ())
print "Creating session object ..."
return geasSession.geasSession (self.connections)
def run (self):
# created extra method to get the session, which can be overwritten
# by testRpcApp
--- 33,52 ----
class testApp (GClientApp.GClientApp):
#
---------------------------------------------------------------------------
! # Create a session object
#
---------------------------------------------------------------------------
! def getSession (self):
# set up login handler
self.connections.setLoginHandler (testLoginHandler ())
print "Creating session object ..."
return geasSession.geasSession (self.connections)
+ #
---------------------------------------------------------------------------
+ # Main program
+ #
---------------------------------------------------------------------------
+
def run (self):
# created extra method to get the session, which can be overwritten
# by testRpcApp
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/appserver/src geasInstance.py geasList.py ...,
Reinhard Mueller <=