summaryrefslogtreecommitdiffstats
path: root/module/plugins/Container.py
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-08-03 12:30:52 +0200
committerGravatar Jeix <devnull@localhost> 2010-08-03 12:30:52 +0200
commitb97c7b1d4a6ca288cb945aa823e67685e6da234f (patch)
tree7ed065805b3fbc1a5669f782fe42cbbcf6ab0b5b /module/plugins/Container.py
parentnew dlc plugins (diff)
downloadpyload-b97c7b1d4a6ca288cb945aa823e67685e6da234f.tar.xz
Container updated to new interface
Diffstat (limited to 'module/plugins/Container.py')
-rw-r--r--module/plugins/Container.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/module/plugins/Container.py b/module/plugins/Container.py
index 729dc11e1..9f0b28884 100644
--- a/module/plugins/Container.py
+++ b/module/plugins/Container.py
@@ -29,3 +29,46 @@ class Container(Crypter):
__description__ = """Base container plugin"""
__author_name__ = ("mkaay")
__author_mail__ = ("mkaay@mkaay.de")
+
+
+
+ #----------------------------------------------------------------------
+ def preprocessing(self, thread):
+ """prepare"""
+ self.thread = thread
+
+ self.decrypt(self.pyfile)
+ self.deleteTmp()
+
+ self.createPackages()
+
+
+ #----------------------------------------------------------------------
+ def loadToDisk(self):
+ """loads container to disk if its stored remotely and overwrite url,
+ or check existent on several places at disk"""
+
+ if self.pyfile.url.startswith("http://"):
+ self.pyfile.name = re.findall("([^\/=]+)", self.pyfile.url)[-1]
+ content = self.load(self.pyfile.url)
+ self.pyfile.url = join(self.config["general"]["download_folder"], self.pyfile.name)
+ f = open(self.pyfile.url, "wb" )
+ f.write(content)
+ f.close()
+
+ else:
+ self.pyfile.name = basename(self.pyfile.url)
+ if not exists(self.pyfile.url):
+ if exists(join(pypath, self.pyfile.url)):
+ self.pyfile.url = join(pypath, self.pyfile.url)
+ else:
+ self.fail(_("File not exists."))
+
+
+
+ #----------------------------------------------------------------------
+ def deleteTmp(self):
+ if self.pyfile.name.startswith("tmp_"):
+ os.remove(self.pyfile.url)
+
+ \ No newline at end of file