summaryrefslogtreecommitdiffstats
path: root/module/plugins/Container.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 00:29:57 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:02:23 +0200
commit68d662e689cd42687341c550fb6ebb74e6968d21 (patch)
tree486cef41bd928b8db704894233b2cef94a6e346f /module/plugins/Container.py
parentsave_join -> safe_join & save_path -> safe_filename (diff)
downloadpyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz
module -> pyload
Diffstat (limited to 'module/plugins/Container.py')
-rw-r--r--module/plugins/Container.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/module/plugins/Container.py b/module/plugins/Container.py
deleted file mode 100644
index 59efbd8dd..000000000
--- a/module/plugins/Container.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-
-from os import remove
-from os.path import basename, exists
-
-from module.plugins.Crypter import Crypter
-from module.utils import safe_join
-
-
-class Container(Crypter):
- __name__ = "Container"
- __type__ = "container"
- __version__ = "0.1"
-
- __pattern__ = None
-
- __description__ = """Base container decrypter plugin"""
- __author_name__ = "mkaay"
- __author_mail__ = "mkaay@mkaay.de"
-
-
- def preprocessing(self, thread):
- """prepare"""
-
- self.setup()
- self.thread = thread
-
- self.loadToDisk()
-
- 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 = safe_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(safe_join(pypath, self.pyfile.url)):
- self.pyfile.url = safe_join(pypath, self.pyfile.url)
- else:
- self.fail(_("File not exists."))
-
-
- def deleteTmp(self):
- if self.pyfile.name.startswith("tmp_"):
- remove(self.pyfile.url)