summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-06 17:28:41 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-06 17:28:41 +0200
commite401472c292205cd0ca4c286d8a3ec42982783ed (patch)
tree74726a6ca3239140599a755d779f900190e7eb4e /pyLoadCore.py
parentLittle bits to settings design (diff)
downloadpyload-e401472c292205cd0ca4c286d8a3ec42982783ed.tar.xz
container upload fix
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py12
1 files changed, 4 insertions, 8 deletions
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')