commit-gnue
[Top][All Lists]
Advanced

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

gnue/common/src/commdrivers _test/server.py _te...


From: Jan Ischebeck
Subject: gnue/common/src/commdrivers _test/server.py _te...
Date: Sun, 21 Apr 2002 21:02:00 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jan Ischebeck <address@hidden>  02/04/21 21:02:00

Modified files:
        common/src/commdrivers/_test: server.py test.py README 
        common/src/commdrivers/xmlrpc: ClientAdapter.py 

Log message:
        Get the XMLRPC - ClientAdapter working, and updated the testcase + 
README

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/_test/server.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/_test/test.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/_test/README.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/common/src/commdrivers/_test/README
diff -c gnue/common/src/commdrivers/_test/README:1.1 
gnue/common/src/commdrivers/_test/README:1.2
*** gnue/common/src/commdrivers/_test/README:1.1        Wed Dec  5 18:15:58 2001
--- gnue/common/src/commdrivers/_test/README    Sun Apr 21 21:02:00 2002
***************
*** 5,7 ****
--- 5,23 ----
  examples in here DO NOT MEAN ANYTHING!!
  
  *****************************************
+ 
+ 2002-04-02  
+ ... but they are working...
+ 
+ 1. just install GNUE/common 
+ 2. get the XMLRPC stuff from http://www.pythonware.com/products/xmlrpc/
+    or just type (just for DEBIAN GNU/LINUX: 
+       "apt-get install python-xmlrpc")
+ 3. setup your PYTHONPATH 
+    (if you are running GNU Forms from your local cvs copy
+     just get the path settings from ~/bin/gfcvs )
+ 4. call the server: python server.py
+         (hint: append "-Z --debug-level 6" to see 
+                whats going on)
+ 5. now call the client: python test.py
+ 6. dream about donuts
Index: gnue/common/src/commdrivers/_test/server.py
diff -c gnue/common/src/commdrivers/_test/server.py:1.7 
gnue/common/src/commdrivers/_test/server.py:1.8
*** gnue/common/src/commdrivers/_test/server.py:1.7     Wed Feb 27 15:45:53 2002
--- gnue/common/src/commdrivers/_test/server.py Sun Apr 21 21:02:00 2002
***************
*** 47,58 ****
      self.flavor = flavor
  
    def get_unitLocation(self):
!     return flavor
  
  #  def set_unitLocation(self, unitLocation):
  #    self.unitLocation = unitLocation
  
  
  
  
  
--- 47,60 ----
      self.flavor = flavor
  
    def get_unitLocation(self):
!     return self.unitLocation
  
  #  def set_unitLocation(self, unitLocation):
  #    self.unitLocation = unitLocation
  
  
+   def requestDelivery(self,address):
+     return "packed and delivered ... now!"
  
  
  
Index: gnue/common/src/commdrivers/_test/test.py
diff -c gnue/common/src/commdrivers/_test/test.py:1.4 
gnue/common/src/commdrivers/_test/test.py:1.5
*** gnue/common/src/commdrivers/_test/test.py:1.4       Mon Dec 17 00:20:17 2001
--- gnue/common/src/commdrivers/_test/test.py   Sun Apr 21 21:02:00 2002
***************
*** 20,26 ****
  
  
    address = 'Jason Cater\n123 Main St\nMemphis, TN 38001'
!   glazedBakery = donutProvider.Bakery.getBakeryUnit('glazed yeast')
  
    print "  Sending %s donuts to Jason Cater" % glazedBakery.get_flavor()
    print "  Kitchen in use:", glazedBakery.get_unitLocation()
--- 20,26 ----
  
  
    address = 'Jason Cater\n123 Main St\nMemphis, TN 38001'
!   glazedBakery = donutProvider.Bakery.getBakingUnit('glazed yeast')
  
    print "  Sending %s donuts to Jason Cater" % glazedBakery.get_flavor()
    print "  Kitchen in use:", glazedBakery.get_unitLocation()
***************
*** 56,62 ****
  
    params = { 'host': 'localhost',
               'port': 8765,
!              'transport': 'https' }
  
    test('xmlrpc',params)
  
--- 56,62 ----
  
    params = { 'host': 'localhost',
               'port': 8765,
!              'transport': 'http' }
  
    test('xmlrpc',params)
  
***************
*** 80,86 ****
  #
  if __name__ == '__main__':
  
!   test_proxy()
!   #test_xmlrpc()
    #test_sockets()
  
--- 80,88 ----
  #
  if __name__ == '__main__':
  
!   #test_proxy()
!   
!   test_xmlrpc()
!   
    #test_sockets()
  
Index: gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py
diff -c gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.2 
gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.3
*** gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.2     Thu Dec 20 
18:27:27 2001
--- gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py Sun Apr 21 21:02:00 2002
***************
*** 103,118 ****
  
  
    def request(self, service, params={}):
!     proxy = _ProxyObject(self, None, 
servicer=self._server.__getattr__(service))
      return proxy
  
  
!   def close():
!     pass
  
  
    def runMethod(self, method, *args, **params):
!     pass
  
  
  
--- 103,133 ----
  
  
    def request(self, service, params={}):
!     proxy = _ProxyObject(self, service, 
servicer=self._server.__getattr__(service))
      return proxy
  
  
!   def close(self):
!     # do a cleanup of the proxy objects and the object stubs
!     # on the XMLRPC server side
!     pass 
  
  
    def runMethod(self, method, *args, **params):
!     # print "Calling method: %s with attr %s " % method,string.join(args,",")
! 
!     to_call=getattr(self._server,method);
!         
!     result=to_call.__call__(*args, **params)
!     # print "the result is",result,"of type",type(result)
!     
!     # check, if an object handle is send    
!     # TODO: make a better check
!     if type(result)==type("String") and len(result)==40 :
!       # create an proxy for this handle
!       result = _ProxyObject(self, "[%s]" % result)
!     
!     return result
  
  
  
***************
*** 139,145 ****
  
  
    def __call__(self, *args, **params):
!     return self._server.runMethod(self, string.join(self._attrPath,'.'),
                                    *args, **params)
  
  
--- 154,160 ----
  
  
    def __call__(self, *args, **params):
!     return self._adapter.runMethod(string.join(self._attrPath,'.'),
                                    *args, **params)
  
  



reply via email to

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