[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/src/commdrivers/xmlrpc/ServerAdapte...
From: |
Jan Ischebeck |
Subject: |
gnue common/src/commdrivers/xmlrpc/ServerAdapte... |
Date: |
Fri, 03 May 2002 22:52:51 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 02/05/03 22:52:48
Modified files:
common/src/commdrivers/xmlrpc: ServerAdapter.py ClientAdapter.py
appserver/src : geasRpcServer.py
Log message:
i18 fixes and more configuration for the xmlrpc ClientAdapter
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasRpcServer.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnue/appserver/src/geasRpcServer.py
diff -c gnue/appserver/src/geasRpcServer.py:1.1
gnue/appserver/src/geasRpcServer.py:1.2
*** gnue/appserver/src/geasRpcServer.py:1.1 Wed May 1 16:56:22 2002
--- gnue/appserver/src/geasRpcServer.py Fri May 3 22:52:48 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcServer.py,v 1.1 2002/05/01 20:56:22 reinhard Exp $
from geasList import *
from geasSession import *
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcServer.py,v 1.2 2002/05/04 02:52:48 siesel Exp $
from geasList import *
from geasSession import *
***************
*** 46,52 ****
return "Running (%s session created)" % self._sessNo
from gnue.common import GComm, openResource
! from gnue.common.GServerApp import GServerApp
import time
#
=============================================================================
--- 46,52 ----
return "Running (%s session created)" % self._sessNo
from gnue.common import GComm, openResource
! from gnue.common.GServerApp import GServerApp,GConfig
import time
#
=============================================================================
***************
*** 55,60 ****
--- 55,63 ----
class geasRpcServer(GServerApp):
+ NAME = "GNUe Application Server"
+ VERSION = "0.0.1"
+
## set a list of transports
def setTransports(self,transports):
***************
*** 64,70 ****
def run(self):
# Create the various servers
! servers=GComm.bind ( "GEAS.grpc",
self._transports,
{'SessionManager': self.requestSessionManager })
--- 67,74 ----
def run(self):
# Create the various servers
! servers=GComm.bind (GConfig.getInstalledBase('install_prefix')+\
! '/shared/grpc/GEAS.grpc',
self._transports,
{'SessionManager': self.requestSessionManager })
Index: gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py
diff -c gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.5
gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.6
*** gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py:1.5 Fri May 3
14:12:46 2002
--- gnue/common/src/commdrivers/xmlrpc/ClientAdapter.py Fri May 3 22:52:48 2002
***************
*** 25,32 ****
# Set of classes that implement the XML-RPC client adapter for GNUe Comm.
#
# NOTES:
! # Requires xmlrpclib from http://www.pythonware.com/products/xmlrpc/
! # or Python 2.2
#
# Client Parameters:
#
--- 25,31 ----
# Set of classes that implement the XML-RPC client adapter for GNUe Comm.
#
# NOTES:
! # Requires py-xmlrpc from http://py-xmlrpc.sourceforge.net/
#
# Client Parameters:
#
***************
*** 43,49 ****
#
# We provide a client driver...
#
! CLIENT = 1 # ClientAdapter
from gnue.common.commdrivers import GCommBase
--- 42,48 ----
#
# We provide a client driver...
#
! CLIENT = 1 # Client Adapter
from gnue.common.commdrivers import GCommBase
***************
*** 83,102 ****
url = params['url']
if not len(url):
raise KeyError
! ## todo: split url into server + host + path parts
except KeyError:
try:
transport = params['transport']
except KeyError:
transport = 'http'
try:
path = params['path']
except KeyError:
path = '/'
! url = "%s://%s:%s/" % \
! ( transport, params['host'], params['port'] )
# setLoglevel
if hasattr(params,'loglevel'):
--- 82,114 ----
url = params['url']
if not len(url):
raise KeyError
!
! # split url into server + host + path parts
! import urlparse
!
! transport, netloc, path, params, query, fragment = \
! urlparse.urlparse(url)
! host, path=split(netloc,':',1)
!
except KeyError:
try:
transport = params['transport']
except KeyError:
transport = 'http'
+
+ if (transport!='http'):
+ raise GComm.AdapterConfigurationError, \
+ "py-xmlrpc just support http as a transport. " +\
+ "If you need https please have a look at the " +\
+ "'pw_xmlrpc' adapter."
try:
path = params['path']
except KeyError:
path = '/'
! url = "%s://%s:%s%s" % \
! ( transport, params['host'], params['port'],path )
# setLoglevel
if hasattr(params,'loglevel'):
***************
*** 105,113 ****
xmlrpc.setLogLevel(1)
self._client = xmlrpc.client(params['host'],
! params['port'],path)
!
!
except KeyError:
raise GComm.AdapterConfigurationError, \
--- 117,123 ----
xmlrpc.setLogLevel(1)
self._client = xmlrpc.client(params['host'],
! params['port'],path)
except KeyError:
raise GComm.AdapterConfigurationError, \
***************
*** 119,133 ****
def request(self, service, params={}):
! proxy = _ProxyObject(self, service)
! return proxy
def close(self):
# do a cleanup of the proxy objects and the object stubs
# on the XMLRPC server side
pass
def setTimeout(self,timeout):
self._timeout=timeout
--- 129,150 ----
def request(self, service, params={}):
! self._baseproxy = _ProxyObject(self, service)
! return self._baseproxy
def close(self):
# do a cleanup of the proxy objects and the object stubs
# on the XMLRPC server side
+ self._client=None
pass
+ # just in case the user forgot to delete some objects
+ def __del__(self):
+ if self._client!=None:
+ self.close()
+ GCommBase.Client.__del__()
+
def setTimeout(self,timeout):
self._timeout=timeout
***************
*** 138,144 ****
def runMethod(self, method, *args, **params):
# print "Calling method: %s with attr %s " % method,string.join(args,",")
! # send authentification info?
if hasattr(self,'_auth_name'):
result = self._client.execute(method, args, self._timeout, \
self._auth_name, self._auth_passw)
--- 155,161 ----
def runMethod(self, method, *args, **params):
# print "Calling method: %s with attr %s " % method,string.join(args,",")
! # send authentication info?
if hasattr(self,'_auth_name'):
result = self._client.execute(method, args, self._timeout, \
self._auth_name, self._auth_passw)
Index: gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py
diff -c gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.11
gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.12
*** gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py:1.11 Fri May 3
14:12:46 2002
--- gnue/common/src/commdrivers/xmlrpc/ServerAdapter.py Fri May 3 22:52:48 2002
***************
*** 184,190 ****
method=method[i+2:]
except ValueError:
raise AttributeError, \
! _("Wrong format of object handler ") \
_("in method call %s") % method
# TODO check in service dir, if obj is supported or not
o=ObjectLibrarian.retrieveObject(objhandle)
--- 184,190 ----
method=method[i+2:]
except ValueError:
raise AttributeError, \
! _("Wrong format of object handler ")+\
_("in method call %s") % method
# TODO check in service dir, if obj is supported or not
o=ObjectLibrarian.retrieveObject(objhandle)
***************
*** 201,211 ****
if server_method==None:
raise AttributeError, \
! _("Server XML-RPC method %s is not ") \
_("bound to real method") % method
except KeyError:
raise AttributeError, \
! _("Server does not have XML-RPC ") \
_("procedure %s") % method
try:
#
--- 201,211 ----
if server_method==None:
raise AttributeError, \
! _("Server XML-RPC method %s is not ") +\
_("bound to real method") % method
except KeyError:
raise AttributeError, \
! _("Server does not have XML-RPC ") +\
_("procedure %s") % method
try:
#
***************
*** 213,219 ****
# TODO: Compare submitted attributs with signature
except KeyError:
raise AttributeError, \
! _("Server XML-RPC ") \
_("procedure %s accepts just %s as attributs") % (method,attr)
# replace object handles in param with the real object
--- 213,219 ----
# TODO: Compare submitted attributs with signature
except KeyError:
raise AttributeError, \
! _("Server XML-RPC ") +\
_("procedure %s accepts just %s as attributs") % (method,attr)
# replace object handles in param with the real object
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue common/src/commdrivers/xmlrpc/ServerAdapte...,
Jan Ischebeck <=