-#!/usr/bin/env python
-# Copyright (C) 2006-2013 CEA/DEN, EDF R&D
+#!/usr/bin/env python3
+# Copyright (C) 2006-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-import xmlrpclib,sys
+import xmlrpc.client,sys
data="""
<methodCall>
</methodCall>
"""
def echo(args):
- print args
+ print(args)
return 96785439
f=open("input")
data=f.read()
f.close()
-params, method = xmlrpclib.loads(data)
+params, method = xmlrpc.client.loads(data)
try:
call=eval(method)
response = (response,)
except:
# report exception back to server
- response = xmlrpclib.dumps( xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2]))
+ response = xmlrpc.client.dumps( xmlrpc.client.Fault(1, "%s:%s" % sys.exc_info()[:2]))
else:
- response = xmlrpclib.dumps( response, methodresponse=1)
+ response = xmlrpc.client.dumps( response, methodresponse=1)
-print response
+print(response)
f=open("output",'w')
f.write(response)
f.close()