git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleaned up globals - except in the foreign plugins for eucalyptus and MAX
[sfa.git]
/
sfa
/
server
/
modpythonapi
/
BaseClient.py
diff --git
a/sfa/server/modpythonapi/BaseClient.py
b/sfa/server/modpythonapi/BaseClient.py
index
5dd72a1
..
56d7286
100755
(executable)
--- a/
sfa/server/modpythonapi/BaseClient.py
+++ b/
sfa/server/modpythonapi/BaseClient.py
@@
-2,12
+2,6
@@
import xmlrpclib
from ApiExceptionCodes import *
from ApiExceptionCodes import *
-VerboseExceptions = False
-
-def EnableVerboseExceptions(x=True):
- global VerboseExceptions
- VerboseExceptions = x
-
class ExceptionUnmarshaller(xmlrpclib.Unmarshaller):
def close(self):
try:
class ExceptionUnmarshaller(xmlrpclib.Unmarshaller):
def close(self):
try:
@@
-19,7
+13,7
@@
class ExceptionUnmarshaller(xmlrpclib.Unmarshaller):
if "\nFAULT_TRACEBACK:" in e.faultString:
parts = e.faultString.split("\nFAULT_TRACEBACK:")
e.faultString = parts[0]
if "\nFAULT_TRACEBACK:" in e.faultString:
parts = e.faultString.split("\nFAULT_TRACEBACK:")
e.faultString = parts[0]
- if VerboseExceptions:
+ if
BaseClient.
VerboseExceptions:
print "\n|Server Traceback:", "\n|".join(parts[1].split("\n"))
raise e
print "\n|Server Traceback:", "\n|".join(parts[1].split("\n"))
raise e
@@
-38,9
+32,17
@@
class ExceptionReportingTransport(xmlrpclib.Transport):
return parser, unmarshaller
class BaseClient():
return parser, unmarshaller
class BaseClient():
+
+ VerboseExceptions = False
+
def __init__(self, url):
self.url = url
self.server = xmlrpclib.ServerProxy(self.url, ExceptionReportingTransport())
def noop(self, value):
return self.server.noop(value)
def __init__(self, url):
self.url = url
self.server = xmlrpclib.ServerProxy(self.url, ExceptionReportingTransport())
def noop(self, value):
return self.server.noop(value)
+
+ @staticmethod
+ def EnableVerboseExceptions(x=True):
+ BaseClient.VerboseExceptions = x
+