MCPcopy Index your code
hub / github.com/pyload/pyload / _make_tmpfile

Method _make_tmpfile

module/plugins/internal/Container.py:50–72  ·  view source on GitHub ↗

Loads container to disk if its stored remotely and overwrite url, or check existent on several places at disk

(self)

Source from the content-addressed store, hash-verified

48 self.remove(self.pyfile.url, trash=False)
49
50 def _make_tmpfile(self):
51 """
52 Loads container to disk if its stored remotely and overwrite url,
53 or check existent on several places at disk
54 """
55 remote = bool(urlparse.urlparse(self.pyfile.url).netloc)
56
57 if remote:
58 content = self.load(self.pyfile.url)
59
60 self.pyfile.name = "tmp_" + self.pyfile.name
61 self.pyfile.url = safejoin(self.pyload.config.get('general', 'download_folder'),
62 self.pyfile.name)
63
64 try:
65 with open(fs_encode(self.pyfile.url), "wb") as f:
66 f.write(encode(content))
67
68 except IOError, e:
69 self.fail(e.message)
70
71 elif not exists(self.pyfile.url):
72 self.fail(_("File not found"))

Callers 1

processMethod · 0.95

Calls 9

safejoinFunction · 0.85
encodeFunction · 0.85
existsFunction · 0.85
fs_encodeFunction · 0.70
_Function · 0.50
loadMethod · 0.45
getMethod · 0.45
writeMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected