diff options
Diffstat (limited to 'module/plugins/Container.py')
-rw-r--r-- | module/plugins/Container.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/module/plugins/Container.py b/module/plugins/Container.py index ed201e2e4..c233d3710 100644 --- a/module/plugins/Container.py +++ b/module/plugins/Container.py @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - + @author: mkaay """ @@ -23,15 +23,14 @@ from os.path import join, exists, basename from os import remove import re - class Container(Crypter): __name__ = "Container" __version__ = "0.1" __pattern__ = None __type__ = "container" - __description__ = """Base container decrypter plugin""" - __author_name__ = "mkaay" - __author_mail__ = "mkaay@mkaay.de" + __description__ = """Base container plugin""" + __author_name__ = ("mkaay") + __author_mail__ = ("mkaay@mkaay.de") def preprocessing(self, thread): @@ -39,27 +38,27 @@ class Container(Crypter): 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 = join(self.config['general']['download_folder'], self.pyfile.name) + 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): @@ -67,8 +66,10 @@ class Container(Crypter): self.pyfile.url = join(pypath, self.pyfile.url) else: self.fail(_("File not exists.")) - + def deleteTmp(self): if self.pyfile.name.startswith("tmp_"): remove(self.pyfile.url) + + |