commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/appserver/src frontend.py geasBClass.py ge...


From: Reinhard Mueller
Subject: gnue/appserver/src frontend.py geasBClass.py ge...
Date: Sat, 01 Feb 2003 10:02:45 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Reinhard Mueller <address@hidden>       03/02/01 10:02:45

Modified files:
        appserver/src  : frontend.py geasBClass.py geasSession.py 
                         test.py test2.py 
        appserver/src/language: Object.py Session.py 

Log message:
        Changed all class and property names to be prefixed with a module name.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/frontend.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasBClass.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/test.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/test2.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/language/Object.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/language/Session.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/appserver/src/frontend.py
diff -c gnue/appserver/src/frontend.py:1.8 gnue/appserver/src/frontend.py:1.9
*** gnue/appserver/src/frontend.py:1.8  Tue Jan  7 16:56:56 2003
--- gnue/appserver/src/frontend.py      Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: frontend.py,v 1.8 2003/01/07 21:56:56 reinhard Exp $
  
  import os, getpass
  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: frontend.py,v 1.9 2003/02/01 15:02:45 reinhard Exp $
  
  import os, getpass
  from gnue.common import GClientApp
***************
*** 131,137 ****
  
      for index in range (0, count):
        object = rset [index]
!       print "* Object number %d with id %s:" % (start + index, object 
["_id_"])
        for property in self.propertylist:
          print "*   " + property + ":", object [property]
  
--- 131,138 ----
  
      for index in range (0, count):
        object = rset [index]
!       print "* Object number %d with id %s:" % (start + index,
!                                                 object ["gnue_id"])
        for property in self.propertylist:
          print "*   " + property + ":", object [property]
  
***************
*** 168,174 ****
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["_id_"])
  
      # now, we have all object_ids and we can use "load" to get the data
      rset = self.server.load (self.session, self.classname, object_ids,
--- 169,175 ----
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["gnue_id"])
  
      # now, we have all object_ids and we can use "load" to get the data
      rset = self.server.load (self.session, self.classname, object_ids,
***************
*** 213,219 ****
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["_id_"])
  
      # Now, we have all object_ids and we can use "load" to get the data.
      # This is not necessary for the subsequent call of "store", it's just
--- 214,220 ----
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["gnue_id"])
  
      # Now, we have all object_ids and we can use "load" to get the data.
      # This is not necessary for the subsequent call of "store", it's just
***************
*** 283,289 ****
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["_id_"])
  
      # Now, delete the objects
      self.server.delete (self.session, self.classname, object_ids)
--- 284,290 ----
      object_ids = []
      for index in range (0, count):
        object = rset [index]
!       object_ids.append (object ["gnue_id"])
  
      # Now, delete the objects
      self.server.delete (self.session, self.classname, object_ids)
Index: gnue/appserver/src/geasBClass.py
diff -c gnue/appserver/src/geasBClass.py:1.3 
gnue/appserver/src/geasBClass.py:1.4
*** gnue/appserver/src/geasBClass.py:1.3        Sun Jan 26 14:13:59 2003
--- gnue/appserver/src/geasBClass.py    Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasBClass.py,v 1.3 2003/01/26 19:13:59 reinhard Exp $
  
  from gnue.common import GDataSource,GConditions
  import geasInstance
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasBClass.py,v 1.4 2003/02/01 15:02:45 reinhard Exp $
  
  from gnue.common import GDataSource,GConditions
  import geasInstance
***************
*** 109,115 ****
        pass
  
      # 2. set prefetch
!     propertylist.add('_id_')
      self._prefetch=propertylist
  
      # 3. load recordset
--- 109,115 ----
        pass
  
      # 2. set prefetch
!     propertylist.add('gnue_id')
      self._prefetch=propertylist
  
      # 3. load recordset
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.21 
gnue/appserver/src/geasSession.py:1.22
*** gnue/appserver/src/geasSession.py:1.21      Tue Jan  7 16:56:56 2003
--- gnue/appserver/src/geasSession.py   Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.21 2003/01/07 21:56:56 reinhard Exp $
  
  import geasList
  import geasTrigger 
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.22 2003/02/01 15:02:45 reinhard Exp $
  
  import geasList
  import geasTrigger 
***************
*** 167,175 ****
      # FIXME: this list needn't be considered by commit and rollback
      list = self.createList (classname)
      list_id = self._listcount
! 
!     # TODO: add a config_option to set the name of the ID field in the DB 
table
!     list.setPrefetch (["_id_"] + propertylist)
      list.setConditions (conditions)
      list.setSort (sortorder)
      list.populate ()
--- 167,173 ----
      # FIXME: this list needn't be considered by commit and rollback
      list = self.createList (classname)
      list_id = self._listcount
!     list.setPrefetch (["gnue_id"] + propertylist)
      list.setConditions (conditions)
      list.setSort (sortorder)
      list.populate ()
***************
*** 199,211 ****
    def load (self, classname, obj_id_list, propertylist):
      # create a temporary geasList
      list = geasList.geasList (self, classname)
!     list.setPrefetch (["_id_"] + propertylist)
!     list.setSort (["_id_"])
      # Accessing the database for every single object_id is not very elegant,
      # but for now it works. -- Reinhard
      result = []
      for object_id in obj_id_list:
!       list.setConditions ([['eq', ''], ['field', '_id_'], ['const', 
object_id]])
        list.populate ()
        object = list.firstInstance ()
        row = {}
--- 197,210 ----
    def load (self, classname, obj_id_list, propertylist):
      # create a temporary geasList
      list = geasList.geasList (self, classname)
!     list.setPrefetch (["gnue_id"] + propertylist)
!     list.setSort (["gnue_id"])
      # Accessing the database for every single object_id is not very elegant,
      # but for now it works. -- Reinhard
      result = []
      for object_id in obj_id_list:
!       list.setConditions ([['eq', ''], ['field', 'gnue_id'],
!                            ['const', object_id]])
        list.populate ()
        object = list.firstInstance ()
        row = {}
***************
*** 235,252 ****
        list = self.createList (classname)
        # We need to "reference" all properties so they become updated. This
        # also should be changed. -- Reinhard
!       list.setPrefetch (["_id_"] + propertylist)
!       list.setSort (["_id_"])
        # Even for an empty object_id, we need to popluate the list.
!       list.setConditions ([['eq', ''], ['field', '_id_'], ['const', 
object_id]])
        list.populate ()
        if object_id:
          object = list.firstInstance ()
          result.append (object_id)
        else:
          object = list.insertNewInstance ()
!         object.put ("_id_", new_object_id ())
!         result.append (object.get ("_id_"))
        row = data [i]
        j = 0
        for property in propertylist:
--- 234,252 ----
        list = self.createList (classname)
        # We need to "reference" all properties so they become updated. This
        # also should be changed. -- Reinhard
!       list.setPrefetch (["gnue_id"] + propertylist)
!       list.setSort (["gnue_id"])
        # Even for an empty object_id, we need to popluate the list.
!       list.setConditions ([['eq', ''], ['field', 'gnue_id'],
!                            ['const', object_id]])
        list.populate ()
        if object_id:
          object = list.firstInstance ()
          result.append (object_id)
        else:
          object = list.insertNewInstance ()
!         object.put ("gnue_id", new_object_id ())
!         result.append (object.get ("gnue_id"))
        row = data [i]
        j = 0
        for property in propertylist:
***************
*** 263,271 ****
      for object_id in obj_id_list:
        # create a temporary geasList
        list = self.createList (classname)
!       list.setPrefetch (["_id_"])
!       list.setSort (["_id_"])
!       list.setConditions ([['eq', ''], ['field', '_id_'], ['const', 
object_id]])
        list.populate ()
        object = list.firstInstance ()
        object.delete ()
--- 263,272 ----
      for object_id in obj_id_list:
        # create a temporary geasList
        list = self.createList (classname)
!       list.setPrefetch (["gnue_id"])
!       list.setSort (["gnue_id"])
!       list.setConditions ([['eq', ''], ['field', 'gnue_id'],
!                            ['const', object_id]])
        list.populate ()
        object = list.firstInstance ()
        object.delete ()
***************
*** 279,291 ****
    def call(self,classname,obj_id_list,methodname,parameters):    
      # create a temporary geasList
      list = geasList.geasList (self, classname)
!     list.setPrefetch (["_id_"] + propertylist)
!     list.setSort (["_id_"])
      # Accessing the database for every single object_id is not very elegant,
      # but for now it works. -- Reinhard
      result = []
      for object_id in obj_id_list:
!       list.setConditions ([['eq', ''], ['field', '_id_'], ['const', 
object_id]])
        list.populate ()
        object = list.firstInstance ()
        result.append (object.call(methodname,parameters))
--- 280,293 ----
    def call(self,classname,obj_id_list,methodname,parameters):    
      # create a temporary geasList
      list = geasList.geasList (self, classname)
!     list.setPrefetch (["gnue_id"] + propertylist)
!     list.setSort (["gnue_id"])
      # Accessing the database for every single object_id is not very elegant,
      # but for now it works. -- Reinhard
      result = []
      for object_id in obj_id_list:
!       list.setConditions ([['eq', ''], ['field', 'gnue_id'],
!                            ['const', object_id]])
        list.populate ()
        object = list.firstInstance ()
        result.append (object.call(methodname,parameters))
Index: gnue/appserver/src/language/Object.py
diff -c gnue/appserver/src/language/Object.py:1.2 
gnue/appserver/src/language/Object.py:1.3
*** gnue/appserver/src/language/Object.py:1.2   Thu Jan 16 07:16:03 2003
--- gnue/appserver/src/language/Object.py       Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: Object.py,v 1.2 2003/01/16 12:16:03 jvetter Exp $
  
  import sys
  
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: Object.py,v 1.3 2003/02/01 15:02:45 reinhard Exp $
  
  import sys
  
***************
*** 46,52 ****
  
      # if a dictionary with instance data is given, populate the cache
      if objData:
!       self.objectId = objData['_id_']
  
        # transfer all data from objData to the initial cache
        for key in objData.keys ():
--- 46,52 ----
  
      # if a dictionary with instance data is given, populate the cache
      if objData:
!       self.objectId = objData['gnue_id']
  
        # transfer all data from objData to the initial cache
        for key in objData.keys ():
***************
*** 105,111 ****
  
      # make sure the property-list and the data-list have the same order
      for key in self._cache.keys ():
!       if key == '_id_': 
        continue
        prop.append (key)
        data.append (self._cache[key])
--- 105,111 ----
  
      # make sure the property-list and the data-list have the same order
      for key in self._cache.keys ():
!       if key == 'gnue_id': 
        continue
        prop.append (key)
        data.append (self._cache[key])
Index: gnue/appserver/src/language/Session.py
diff -c gnue/appserver/src/language/Session.py:1.1 
gnue/appserver/src/language/Session.py:1.2
*** gnue/appserver/src/language/Session.py:1.1  Tue Jan 14 09:40:49 2003
--- gnue/appserver/src/language/Session.py      Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: Session.py,v 1.1 2003/01/14 14:40:49 jvetter Exp $
  
  from gnue.common import GClientApp
  from gnue.common import GLoginHandler
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: Session.py,v 1.2 2003/02/01 15:02:45 reinhard Exp $
  
  from gnue.common import GClientApp
  from gnue.common import GLoginHandler
***************
*** 88,94 ****
    # -------------------------------------------------------------------------
    # Return a collection of 'classname' matching the given arguments
    # -------------------------------------------------------------------------
!   def find (self, classname, cond=[], sort=['_id_'], properties=[]):
      return newList (self._server, self._session_id, classname, cond, sort,
                      properties)
  
--- 88,94 ----
    # -------------------------------------------------------------------------
    # Return a collection of 'classname' matching the given arguments
    # -------------------------------------------------------------------------
!   def find (self, classname, cond=[], sort=['gnue_id'], properties=[]):
      return newList (self._server, self._session_id, classname, cond, sort,
                      properties)
  
Index: gnue/appserver/src/test.py
diff -c gnue/appserver/src/test.py:1.13 gnue/appserver/src/test.py:1.14
*** gnue/appserver/src/test.py:1.13     Wed Jan  1 19:45:41 2003
--- gnue/appserver/src/test.py  Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: test.py,v 1.13 2003/01/02 00:45:41 jcater 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.14 2003/02/01 15:02:45 reinhard Exp $
  
  import os
  from gnue.common import GClientApp
***************
*** 56,67 ****
      session.login ("hacker", "secret")
  
      print "Creating list object ..."
!     list = session.createList ("person")
  
      print "Setting up list object ..."
!     list.setPrefetch (["name", "street", "city"])
      list.setConditions ([])
!     list.setSort (["zip"])
  
      print "Populating list ..."
      list.populate ()
--- 56,67 ----
      session.login ("hacker", "secret")
  
      print "Creating list object ..."
!     list = session.createList ("address_person")
  
      print "Setting up list object ..."
!     list.setPrefetch (["address_name", "address_street", "address_city"])
      list.setConditions ([])
!     list.setSort (["address_zip"])
  
      print "Populating list ..."
      list.populate ()
***************
*** 70,82 ****
      instance = list.firstInstance ()
  
      print "These are the values of the first instance:"
!     print "  Name  :", instance.get ("name")
!     print "  Street:", instance.get ("street")
!     print "  City  :", instance.get ("city")
! 
!     print "Check if person live in a rich/poor area:"
!     print "  calling 'checkAreaRichness' results in: ", 
!     instance.call('checkAreaRichness','') # demographic data
  
      print "Thank you for playing!"
  
--- 70,82 ----
      instance = list.firstInstance ()
  
      print "These are the values of the first instance:"
!     print "  Name  :", instance.get ("address_name")
!     print "  Street:", instance.get ("address_street")
!     print "  City  :", instance.get ("address_city")
! 
! #   print "Check if person live in a rich/poor area:"
! #   print "  calling 'checkAreaRichness' results in: ", 
! #   instance.call('checkAreaRichness','') # demographic data
  
      print "Thank you for playing!"
  
Index: gnue/appserver/src/test2.py
diff -c gnue/appserver/src/test2.py:1.6 gnue/appserver/src/test2.py:1.7
*** gnue/appserver/src/test2.py:1.6     Sat Jan  4 11:30:38 2003
--- gnue/appserver/src/test2.py Sat Feb  1 10:02:45 2003
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: test2.py,v 1.6 2003/01/04 16:30:38 reinhard 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: test2.py,v 1.7 2003/02/01 15:02:45 reinhard Exp $
  
  import os
  from gnue.common import GClientApp
***************
*** 59,74 ****
      session=sm.open({'user':"hacker", 'password':"secret"})
  
      print "Creating and populating list object ..."
!     list = sm.request(session, "person", [], ["zip"],
!                       ["name", "street", "city"])
  
      print "Retrieving first instance ..."
      rset = sm.fetch(session,list,0,1)
  
      print "These are the values of the first instance:"
!     print "  Name  :", rset[0]["name"]
!     print "  Street:", rset[0]["street"]
!     print "  City  :", rset[0]["city"]
  
  #    print "Check if person live in a rich/poor area:"
  #    print "  calling 'checkAreaRichness' results in: ", 
--- 59,74 ----
      session=sm.open({'user':"hacker", 'password':"secret"})
  
      print "Creating and populating list object ..."
!     list = sm.request(session, "address_person", [], ["address_zip"],
!                       ["address_name", "address_street", "address_city"])
  
      print "Retrieving first instance ..."
      rset = sm.fetch(session,list,0,1)
  
      print "These are the values of the first instance:"
!     print "  Name  :", rset[0]["address_name"]
!     print "  Street:", rset[0]["address_street"]
!     print "  City  :", rset[0]["address_city"]
  
  #    print "Check if person live in a rich/poor area:"
  #    print "  calling 'checkAreaRichness' results in: ", 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]