summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/Container.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-13 15:56:57 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-13 15:56:57 +0100
commitacc46fc3497a66a427b795b4a22c6e71d69185a1 (patch)
tree2d315b838a76435fc456b972c99c28d1732b2f70 /pyload/plugins/Container.py
parentCode fixes (diff)
downloadpyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz
Update
Diffstat (limited to 'pyload/plugins/Container.py')
-rw-r--r--pyload/plugins/Container.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/pyload/plugins/Container.py b/pyload/plugins/Container.py
deleted file mode 100644
index bcdb433b8..000000000
--- a/pyload/plugins/Container.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from __future__ import with_statement
-
-import re
-
-from os import remove
-from os.path import basename, exists
-
-from pyload.plugins.internal.Crypter import Crypter
-from pyload.utils import safe_join
-
-
-class Container(Crypter):
- __name = "Container"
- __type = "container"
- __version = "0.01"
-
- __pattern = r'^unmatchable$'
- __config = [] #: [("name", "type", "desc", "default")]
-
- __description = """Base container decrypter plugin"""
- __license = "GPLv3"
- __authors = [("mkaay", "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.core.config['general']['download_folder'], self.pyfile.name)
- try:
- with open(self.pyfile.url, "wb") as f:
- f.write(content)
- except IOError, e:
- self.fail(str(e))
-
- 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)