diff options
Diffstat (limited to 'pyload/plugins/base/Container.py')
-rw-r--r-- | pyload/plugins/base/Container.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pyload/plugins/base/Container.py b/pyload/plugins/base/Container.py index 40cc25195..1bb2e204b 100644 --- a/pyload/plugins/base/Container.py +++ b/pyload/plugins/base/Container.py @@ -10,14 +10,16 @@ from pyload.utils import safe_join class Container(Crypter): - __name__ = "Container" - __type__ = "container" - __version__ = "0.1" + __name__ = "Container" + __type__ = "container" + __version__ = "0.01" __pattern__ = None + __config__ = [] #: [("name", "type", "desc", "default")] __description__ = """Base container decrypter plugin""" - __authors__ = [("mkaay", "mkaay@mkaay.de")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de")] def preprocessing(self, thread): @@ -42,9 +44,11 @@ class Container(Crypter): 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() + 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) @@ -52,7 +56,7 @@ class Container(Crypter): if exists(safe_join(pypath, self.pyfile.url)): self.pyfile.url = safe_join(pypath, self.pyfile.url) else: - self.fail(_("File not exists.")) + self.fail(_("File not exists")) def deleteTmp(self): |