Browse Source

Using configuration properties of objects

main
dawryn 10 years ago
parent
commit
8811b307e4
3 changed files with 19 additions and 19 deletions
  1. +1
    -1
      src/SOAPpy/Client.py
  2. +14
    -14
      src/SOAPpy/SOAPBuilder.py
  3. +4
    -4
      src/SOAPpy/Server.py

+ 1
- 1
src/SOAPpy/Client.py View File

@@ -477,7 +477,7 @@ class SOAPProxy:
throw_struct = 0

if throw_struct:
if Config.debug:
if self.config.debug:
print p
raise p



+ 14
- 14
src/SOAPpy/SOAPBuilder.py View File

@@ -100,7 +100,7 @@ class SOAPBuilder:
self.noroot = noroot

def build(self):
if Config.debug: print "In build."
if self.config.debug: print "In build."
ns_map = {}

# Cache whether typing is on or not
@@ -197,7 +197,7 @@ class SOAPBuilder:
return ''.join(self.out)

def gentag(self):
if Config.debug: print "In gentag."
if self.config.debug: print "In gentag."
self.tcounter += 1
return "v%d" % self.tcounter

@@ -279,7 +279,7 @@ class SOAPBuilder:
# dumpers

def dump(self, obj, tag = None, typed = 1, ns_map = {}):
if Config.debug: print "In dump.", "obj=", obj
if self.config.debug: print "In dump.", "obj=", obj
ns_map = ns_map.copy()
self.depth += 1

@@ -293,7 +293,7 @@ class SOAPBuilder:
def dumper(self, nsURI, obj_type, obj, tag, typed = 1, ns_map = {},
rootattr = '', id = '',
xml = '<%(tag)s%(type)s%(id)s%(attrs)s%(root)s>%(data)s</%(tag)s>\n'):
if Config.debug: print "In dumper."
if self.config.debug: print "In dumper."

if nsURI == None:
nsURI = self.config.typesNamespaceURI
@@ -324,12 +324,12 @@ class SOAPBuilder:
"id": id, "attrs": a}

def dump_float(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_float."
if self.config.debug: print "In dump_float."
tag = tag or self.gentag()

tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

if Config.strict_range:
if self.config.strict_range:
doubleType(obj)

if PosInf == obj:
@@ -346,7 +346,7 @@ class SOAPBuilder:
None, "double", obj, tag, typed, ns_map, self.genroot(ns_map)))

def dump_int(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_int."
if self.config.debug: print "In dump_int."
# fix error "Bad types (class java.math.BigInteger -> class java.lang.Integer)"
if isinstance(obj, LongType):
@@ -358,12 +358,12 @@ class SOAPBuilder:
ns_map, self.genroot(ns_map)))

def dump_bool(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_bool."
if self.config.debug: print "In dump_bool."
self.out.append(self.dumper(None, 'boolean', obj, tag, typed,
ns_map, self.genroot(ns_map)))
def dump_string(self, obj, tag, typed = 0, ns_map = {}):
if Config.debug: print "In dump_string."
if self.config.debug: print "In dump_string."
tag = tag or self.gentag()
tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

@@ -381,7 +381,7 @@ class SOAPBuilder:
dump_unicode = dump_string

def dump_None(self, obj, tag, typed = 0, ns_map = {}):
if Config.debug: print "In dump_None."
if self.config.debug: print "In dump_None."
tag = tag or self.gentag()
tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding
ns = self.genns(ns_map, self.config.schemaNamespaceURI)[0]
@@ -392,7 +392,7 @@ class SOAPBuilder:
dump_NoneType = dump_None # For Python 2.2+

def dump_list(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_list.", "obj=", obj
if self.config.debug: print "In dump_list.", "obj=", obj
tag = tag or self.gentag()
tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

@@ -512,7 +512,7 @@ class SOAPBuilder:
dump_tuple = dump_list

def dump_map(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_map.", "obj=", obj
if self.config.debug: print "In dump_map.", "obj=", obj
tag = tag or self.gentag()
tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

@@ -566,7 +566,7 @@ class SOAPBuilder:
self.out.append("</%sFault>\n" % vns)

def dump_dictionary(self, obj, tag, typed = 1, ns_map = {}):
if Config.debug: print "In dump_dictionary."
if self.config.debug: print "In dump_dictionary."
tag = tag or self.gentag()
tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

@@ -596,7 +596,7 @@ class SOAPBuilder:
else:
tag = self.gentag()

# watch out for order!
# watch out for order!
dumpmap = (
(Exception, self.dump_exception),
(mapType, self.dump_map),


+ 4
- 4
src/SOAPpy/Server.py View File

@@ -233,7 +233,7 @@ class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
args = r._aslist()
kw = r._asdict()

if Config.simplify_objects:
if self.server.config.simplify_objects:
args = simplify(args)
kw = simplify(kw)

@@ -253,7 +253,7 @@ class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
ordered_args = {}
named_args = {}

if Config.specialArgs:
if self.server.config.specialArgs:

for (k,v) in kw.items():

@@ -383,7 +383,7 @@ class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
if f.context: # retrieve context object
c = _contexts[thread_id]

if Config.specialArgs:
if self.server.config.specialArgs:
if c:
named_args["_SOAPContext"] = c
fr = apply(f, ordered_args, named_args)
@@ -404,7 +404,7 @@ class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
fr = apply(f, args, {})

else:
if Config.specialArgs:
if self.server.config.specialArgs:
fr = apply(f, ordered_args, named_args)
else:
fr = apply(f, args, {})


Loading…
Cancel
Save