summaryrefslogtreecommitdiff
path: root/suds/reader.py
diff options
context:
space:
mode:
authorjortel <devnull@localhost>2010-09-01 18:40:40 +0000
committerjortel <devnull@localhost>2010-09-01 18:40:40 +0000
commitcd67cdbe0033c5da748f3c02ff0bf5915545efb0 (patch)
tree98b94776c881260be8bf53ba177cd95c92937c44 /suds/reader.py
parent92ecdb75a8e9882a3b8917888a90ebab1082e808 (diff)
downloadsuds-cd67cdbe0033c5da748f3c02ff0bf5915545efb0.tar.gz
Add DocumentPlugin.loaded() hook per ticket 347.
Diffstat (limited to 'suds/reader.py')
-rw-r--r--suds/reader.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/suds/reader.py b/suds/reader.py
index fbd8760..1184f12 100644
--- a/suds/reader.py
+++ b/suds/reader.py
@@ -78,7 +78,7 @@ class DocumentReader(Reader):
if d is None:
d = self.download(url)
cache.put(id, d)
- self.plugins.document.parsed(root=d.root())
+ self.plugins.document.parsed(url=url, document=d.root())
return d
def download(self, url):
@@ -93,8 +93,12 @@ class DocumentReader(Reader):
fp = store.open(url)
if fp is None:
fp = self.options.transport.open(Request(url))
+ content = fp.read()
+ fp.close()
+ ctx = self.plugins.document.loaded(url=url, document=content)
+ content = ctx.document
sax = Parser()
- return sax.parse(file=fp)
+ return sax.parse(string=content)
def cache(self):
"""