MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / open

Method open

suds/reader.py:62–81  ·  view source on GitHub ↗

Open an XML document at the specified I{url}. First, the document attempted to be retrieved from the I{object cache}. If not found, it is downloaded and parsed using the SAX parser. The result is added to the cache for the next open(). @param url: A

(self, url)

Source from the content-addressed store, hash-verified

60 """
61
62 def open(self, url):
63 """
64 Open an XML document at the specified I{url}.
65 First, the document attempted to be retrieved from
66 the I{object cache}. If not found, it is downloaded and
67 parsed using the SAX parser. The result is added to the
68 cache for the next open().
69 @param url: A document url.
70 @type url: str.
71 @return: The specified XML document.
72 @rtype: I{Document}
73 """
74 cache = self.cache()
75 id = self.mangle(url, 'document')
76 d = cache.get(id)
77 if d is None:
78 d = self.download(url)
79 cache.put(id, d)
80 self.plugins.document.parsed(url=url, document=d.root())
81 return d
82
83 def download(self, url):
84 """

Callers 4

__init__Method · 0.95
downloadMethod · 0.95
downloadMethod · 0.95
downloadMethod · 0.45

Calls 7

cacheMethod · 0.95
downloadMethod · 0.95
mangleMethod · 0.80
getMethod · 0.45
putMethod · 0.45
parsedMethod · 0.45
rootMethod · 0.45

Tested by

no test coverage detected