commit-gnue
[Top][All Lists]
Advanced

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

gnue/common/src GDataSource.py commdrivers/xmlr...


From: Jason Cater
Subject: gnue/common/src GDataSource.py commdrivers/xmlr...
Date: Sat, 04 May 2002 12:46:26 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/05/04 12:46:26

Modified files:
        common/src     : GDataSource.py 
        common/src/commdrivers/xmlrpc: ServerAdapter.py 

Log message:
        fixes to datasources

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GDataSource.py.diff?cvsroot=OldCVS&tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: gnue/common/src/GDataSource.py
diff -c gnue/common/src/GDataSource.py:1.30 gnue/common/src/GDataSource.py:1.31
*** gnue/common/src/GDataSource.py:1.30 Fri May  3 19:07:18 2002
--- gnue/common/src/GDataSource.py      Sat May  4 12:46:25 2002
***************
*** 77,87 ****
                                }
  
    def __getattr__(self, attr):
!     print "Calling __getattr__('%s')" % attr
!     if self._dataObject and attr[1] != '_':
        return getattr(self._dataObject,attr)
      else:
!       raise AttributeError
  
  
    def triggerSimpleQuery(self,maskDict):
--- 77,86 ----
                                }
  
    def __getattr__(self, attr):
!     if self._dataObject and attr[1] != '_' and hasattr(self._dataObject,attr):
        return getattr(self._dataObject,attr)
      else:
!       raise AttributeError, attr
  
  
    def triggerSimpleQuery(self,maskDict):
***************
*** 115,127 ****
      self._connections = connectionManager
  
    def initialize(self):
- 
      if not self.database:
        # We are a connectionless datasource (virtual?)
        # We have to bind to something, so bind to empty driver
        from gnue.common.dbdrivers._empty import DBdriver
        GDebug.printMesg (7, 'Using empty data driver')
!       self._dataObject = DBdriver.supportedDataObjects['object']()
  
      elif self._connections:
        self.database = string.lower(self.database)
--- 114,125 ----
      self._connections = connectionManager
  
    def initialize(self):
      if not self.database:
        # We are a connectionless datasource (virtual?)
        # We have to bind to something, so bind to empty driver
        from gnue.common.dbdrivers._empty import DBdriver
        GDebug.printMesg (7, 'Using empty data driver')
!       dataObject = DBdriver.supportedDataObjects['object']()
  
      elif self._connections:
        self.database = string.lower(self.database)
***************
*** 141,151 ****
          dataObject._staticCondition = child
          break
  
- 
      # Copy all attributes from XML to the dataObject
      tagAttributes = getXMLelements()['datasource']['Attributes']
      for attribute in tagAttributes.keys():
!       if hasattr(self, attribute):
          dataObject.__dict__[attribute] = self.__dict__[attribute]
        else:
          try:
--- 139,148 ----
          dataObject._staticCondition = child
          break
  
      # Copy all attributes from XML to the dataObject
      tagAttributes = getXMLelements()['datasource']['Attributes']
      for attribute in tagAttributes.keys():
!       if self.__dict__.has_key(attribute):
          dataObject.__dict__[attribute] = self.__dict__[attribute]
        else:
          try:
Index: gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py
diff -c gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.12 
gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.13
*** gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.12    Fri May  3 
22:52:48 2002
--- gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py Sat May  4 12:46:26 2002
***************
*** 252,269 ****
      # check for empty results (not allowed for XMLRPC)
      if result==None:
        GDebug.printMesg(3,'Transform result None into 1')
!       result=1      
!     
      return result
!   
    def addRegisterDynamicObject(self,result,type):
      #
      #  add new methods to the xmlrpc server
      #
!     tl=len(type)    
      for i in self.directory.keys():
        if i[0:tl]==type:
!         method="["+result+"]"+i[tl:]        
          GDebug.printMesg(1,'Method %s registered to py-xmlrpc ' \
                           % method +\
                           ' internal directory.')
--- 252,269 ----
      # check for empty results (not allowed for XMLRPC)
      if result==None:
        GDebug.printMesg(3,'Transform result None into 1')
!       result=1
! 
      return result
! 
    def addRegisterDynamicObject(self,result,type):
      #
      #  add new methods to the xmlrpc server
      #
!     tl=len(type)
      for i in self.directory.keys():
        if i[0:tl]==type:
!         method="["+result+"]"+i[tl:]
          GDebug.printMesg(1,'Method %s registered to py-xmlrpc ' \
                           % method +\
                           ' internal directory.')
***************
*** 276,285 ****
      #  remove the new methods from the xmlrpc server
      #
      type=object._type
!     tl=len(type)    
      for i in self.directory.keys():
        if i[0:tl]==type:
!         method="["+result+"]"+i[tl:]        
          GDebug.printMesg(1,'Method %s registered to py-xmlrpc ' \
                           % method +\
                           ' internal directory.')
--- 276,285 ----
      #  remove the new methods from the xmlrpc server
      #
      type=object._type
!     tl=len(type)
      for i in self.directory.keys():
        if i[0:tl]==type:
!         method="["+result+"]"+i[tl:]
          GDebug.printMesg(1,'Method %s registered to py-xmlrpc ' \
                           % method +\
                           ' internal directory.')
***************
*** 292,300 ****
  class XMLRPC_Server(xmlrpc.server):
    def setParent(self, parent):
      self._parent=parent
!     
    def dispatch(self, servp, srcp, uri, method, params):
!     return self._parent.call(method,params)      
  
    def deleteMethods(self, dic):
      pass
--- 292,300 ----
  class XMLRPC_Server(xmlrpc.server):
    def setParent(self, parent):
      self._parent=parent
! 
    def dispatch(self, servp, srcp, uri, method, params):
!     return self._parent.call(method,params)
  
    def deleteMethods(self, dic):
      pass



reply via email to

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