diff options
author | jortel <devnull@localhost> | 2010-01-29 13:50:33 +0000 |
---|---|---|
committer | jortel <devnull@localhost> | 2010-01-29 13:50:33 +0000 |
commit | 462c118d0c2feeeed588550c14fabf30ecd42fc5 (patch) | |
tree | 7b1a08923bf1677034ef12cb5858a845979bfaf5 | |
parent | e801f036ab555010d616dc921a2d5a811297dbd5 (diff) | |
download | suds-462c118d0c2feeeed588550c14fabf30ecd42fc5.tar.gz |
Add check for 'options' before del and change to remove list of unwanted options. Also, restore 'options' on imported wsdls when unpickled.
-rw-r--r-- | suds/__init__.py | 2 | ||||
-rw-r--r-- | suds/reader.py | 12 | ||||
-rw-r--r-- | suds/wsdl.py | 9 |
3 files changed, 15 insertions, 8 deletions
diff --git a/suds/__init__.py b/suds/__init__.py index c63fa92..bed0da7 100644 --- a/suds/__init__.py +++ b/suds/__init__.py @@ -27,7 +27,7 @@ import sys # __version__ = '0.3.9' -__build__="(beta) R647-20100128" +__build__="(beta) R648-20100129" # # Exceptions diff --git a/suds/reader.py b/suds/reader.py index 70a7074..54964b0 100644 --- a/suds/reader.py +++ b/suds/reader.py @@ -106,9 +106,10 @@ class DefinitionsReader: """ Open a WSDL at the specified I{url}. First, the WSDL attempted to be retrieved from - the I{object cache}. If not found, it is downloaded and - instantiated using the I{fn} constructor. The result is added - to the cache for the next open(). + the I{object cache}. After unpickled from the cache, the + I{options} attribute is restored. + If not found, it is downloaded and instantiated using the + I{fn} constructor and added to the cache for the next open(). @param url: A WSDL url. @type url: str. @return: The WSDL object. @@ -120,5 +121,8 @@ class DefinitionsReader: if d is None: d = self.fn(url, self.options) cache.put(id, d) - d.options = self.options + else: + d.options = self.options + for imp in d.imports: + imp.imported.options = self.options return d
\ No newline at end of file diff --git a/suds/wsdl.py b/suds/wsdl.py index 2fb54f2..26f15b5 100644 --- a/suds/wsdl.py +++ b/suds/wsdl.py @@ -268,9 +268,12 @@ class Definitions(WObject): body.wrapped = True def __getstate__(self): - d = self.__dict__.copy() - del d['options'] - return d + nopickle = ('options',) + state = self.__dict__.copy() + for k in nopickle: + if k in state: + del state[k] + return state def __repr__(self): return 'Definitions (id=%s)' % self.id |