16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2001 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# xmlrpc/ClientAdapter.py |
# xmlrpc/ClientAdapter.py |
71 |
from xmlrpc import xmlrpc |
from xmlrpc import xmlrpc |
72 |
|
|
73 |
except ImportError: |
except ImportError: |
74 |
raise GComm.AdapterInitializationError, \ |
tmsg = _("\nUnable to load xmlrpc. To use the XML-RPC interface, \n") \ |
75 |
_("\nUnable to load xmlrpc. To use the XML-RPC interface, \n") \ |
+ _("please install xmlrpc from:\n") \ |
76 |
+ _("please install xmlrpc from:\n") \ |
+ " http://sourceforge.net/projects/py-xmlrpc " \ |
77 |
+ " http://sourceforge.net/projects/py-xmlrpc " \ |
+ _("the appropriate DEBIAN package is python-xmlrpc.deb") |
78 |
+ _("the appropriate DEBIAN package is python-xmlrpc.deb") |
raise GComm.AdapterInitializationError, tmsg |
79 |
|
|
80 |
|
|
81 |
############################################################################## |
############################################################################## |
119 |
transport = 'http' |
transport = 'http' |
120 |
|
|
121 |
if (transport!='http'): |
if (transport!='http'): |
122 |
raise GComm.AdapterConfigurationError, \ |
tmsg = _("py-xmlrpc just support http as a transport. ") +\ |
123 |
"py-xmlrpc just support http as a transport. " +\ |
_("If you need https please have a look at the ") +\ |
124 |
"If you need https please have a look at the " +\ |
_("'pw_xmlrpc' adapter.") |
125 |
"'pw_xmlrpc' adapter." |
raise GComm.AdapterConfigurationError, tmsg |
126 |
# |
# |
127 |
# path parameter |
# path parameter |
128 |
# |
# |
173 |
# self._client.setOnErr(self.errorHandler) |
# self._client.setOnErr(self.errorHandler) |
174 |
|
|
175 |
except KeyError: |
except KeyError: |
176 |
raise GComm.AdapterConfigurationError, \ |
tmsg = _("To use XML-RPC, you must either specify a 'url' or\n") +\ |
177 |
_("To use XML-RPC, you must either specify a 'url' or\n") +\ |
_("a 'host' and 'port' setting.") |
178 |
_("a 'host' and 'port' setting.") |
raise GComm.AdapterConfigurationError, tmsg |
179 |
except: |
except: |
180 |
raise GComm.AdapterInitializationError, \ |
tmsg = _("Unable to initialize the XML-RPC interface at %s") % url |
181 |
_("Unable to initialize the XML-RPC interface at %s") % url |
raise GComm.AdapterInitializationError, tmsg |
182 |
|
|
183 |
|
|
184 |
def request(self, service, params={}): |
def request(self, service, params={}): |