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

Method download

suds/reader.py:83–100  ·  view source on GitHub ↗

Download the docuemnt. @param url: A document url. @type url: str. @return: A file pointer to the docuemnt. @rtype: file-like

(self, url)

Source from the content-addressed store, hash-verified

81 return d
82
83 def download(self, url):
84 """
85 Download the docuemnt.
86 @param url: A document url.
87 @type url: str.
88 @return: A file pointer to the docuemnt.
89 @rtype: file-like
90 """
91 store = DocumentStore()
92 fp = store.open(url)
93 if fp is None:
94 fp = self.options.transport.open(Request(url))
95 content = fp.read()
96 fp.close()
97 ctx = self.plugins.document.loaded(url=url, document=content)
98 content = ctx.document
99 sax = Parser()
100 return sax.parse(string=content)
101
102 def cache(self):
103 """

Callers 1

openMethod · 0.95

Calls 7

openMethod · 0.95
parseMethod · 0.95
DocumentStoreClass · 0.90
RequestClass · 0.90
ParserClass · 0.90
loadedMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected