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

Method open

suds/reader.py:134–157  ·  view source on GitHub ↗

Open a WSDL at the specified I{url}. First, the WSDL attempted to be retrieved from 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

(self, url)

Source from the content-addressed store, hash-verified

132 self.fn = fn
133
134 def open(self, url):
135 """
136 Open a WSDL at the specified I{url}.
137 First, the WSDL attempted to be retrieved from
138 the I{object cache}. After unpickled from the cache, the
139 I{options} attribute is restored.
140 If not found, it is downloaded and instantiated using the
141 I{fn} constructor and added to the cache for the next open().
142 @param url: A WSDL url.
143 @type url: str.
144 @return: The WSDL object.
145 @rtype: I{Definitions}
146 """
147 cache = self.cache()
148 id = self.mangle(url, 'wsdl')
149 d = cache.get(id)
150 if d is None:
151 d = self.fn(url, self.options)
152 cache.put(id, d)
153 else:
154 d.options = self.options
155 for imp in d.imports:
156 imp.imported.options = self.options
157 return d
158
159 def cache(self):
160 """

Callers 1

__init__Method · 0.95

Calls 4

cacheMethod · 0.95
mangleMethod · 0.80
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected