From e401472c292205cd0ca4c286d8a3ec42982783ed Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 6 Aug 2010 17:28:41 +0200 Subject: container upload fix --- pyLoadCore.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'pyLoadCore.py') diff --git a/pyLoadCore.py b/pyLoadCore.py index 74cb10d23..d8fb1c965 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -529,16 +529,12 @@ class ServerMethods(): def restart_file(self, fileid): self.core.files.restartFile(int(fileid)) - def upload_container(self, filename, type, content): - #@TODO py2.5 unproofed - th = NamedTemporaryFile(mode="w", suffix="." + type, delete=False) + def upload_container(self, filename, content): + th = open(join(self.core.config["general"]["download_folder"] , "tmp_" + filename), "wb") th.write(str(content)) - path = th.name th.close() - pid = self.core.file_list.packager.addNewPackage(filename) - cid = self.core.file_list.collector.addLink(path) - self.move_file_2_package(cid, pid) - self.core.file_list.save() + + self.add_package(th.name, [th.name], 1) def get_log(self, offset=0): filename = join(self.core.config['log']['log_folder'], 'log.txt') -- cgit v1.2.3