summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:35:20 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:35:20 +0100
commitb5d1c47ac2590fe4314d7e96d58443c30463746c (patch)
treebf35105179c5fc841edc26b86b8ed96f148f2b35 /pyLoadCore.py
parentpluginconfig now in xml (diff)
downloadpyload-b5d1c47ac2590fe4314d7e96d58443c30463746c.tar.xz
gui contaoner upload, closes #39
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 7cf83389e..9e9da2c4b 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -44,7 +44,8 @@ from sys import stdout
import thread
import time
from time import sleep
-from shutil import copyfile
+from shutil import copyfile
+from tempfile import NamedTemporaryFile
from module.file_list import File_List
from module.network.Request import Request
@@ -494,7 +495,17 @@ class ServerMethods():
self.core.file_list.packager.resetFileStatus(id)
def restart_file(self, fileid):
- self.core.file_list.packager.resetFileStatus(fileid)
+ self.core.file_list.packager.resetFileStatus(fileid)
+
+ def upload_container(self, filename, type, content):
+ th = NamedTemporaryFile(mode="w", suffix="."+type, delete=False)
+ th.write(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()
#def move_urls_up(self, ids):
# for id in ids: