diff options
| author | 2010-08-03 12:30:52 +0200 | |
|---|---|---|
| committer | 2010-08-03 12:30:52 +0200 | |
| commit | b97c7b1d4a6ca288cb945aa823e67685e6da234f (patch) | |
| tree | 7ed065805b3fbc1a5669f782fe42cbbcf6ab0b5b /module/plugins/Container.py | |
| parent | new dlc plugins (diff) | |
| download | pyload-b97c7b1d4a6ca288cb945aa823e67685e6da234f.tar.xz | |
Container updated to new interface
Diffstat (limited to 'module/plugins/Container.py')
| -rw-r--r-- | module/plugins/Container.py | 43 | 
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 | 
