summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-14 03:19:07 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-14 03:19:07 +0200
commitc088962dff60ff343273b64e8a2db7c2ebf63c55 (patch)
tree940ae38fb7d1b73a7acd853a7c9a45d7097a2108 /module
parentRemoved __threaded__ attribute (diff)
downloadpyload-c088962dff60ff343273b64e8a2db7c2ebf63c55.tar.xz
[Crypter] Set folder
Diffstat (limited to 'module')
-rw-r--r--module/plugins/Crypter.py31
1 files changed, 11 insertions, 20 deletions
diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py
index 44a47b35b..6c73edc60 100644
--- a/module/plugins/Crypter.py
+++ b/module/plugins/Crypter.py
@@ -1,24 +1,8 @@
# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- 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
-"""
-
from module.plugins.Plugin import Plugin
+
class Crypter(Plugin):
__name__ = "Crypter"
__version__ = "0.1"
@@ -28,6 +12,7 @@ class Crypter(Plugin):
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def __init__(self, pyfile):
Plugin.__init__(self, pyfile)
@@ -58,11 +43,17 @@ class Crypter(Plugin):
""" create new packages from self.packages """
for pack in self.packages:
- self.logDebug("Parsed package %(name)s with %(len)d links" % { "name" : pack[0], "len" : len(pack[1]) } )
+ name, links, folder = pack
+
+ self.logDebug("Parsed package %(name)s with %(len)d links" % {"name": name, "len": len(links)})
+
+ links = [x.decode("utf-8") for x in links]
- links = [x.decode("utf-8") for x in pack[1]]
+ pid = self.core.api.addPackage(name, links, self.pyfile.package().queue)
- pid = self.core.api.addPackage(pack[0], links, self.pyfile.package().queue)
+ if name != folder is not None:
+ self.core.api.setPackageData(pid, {"folder": folder}) #: Due to not break API addPackage method right now
+ self.logDebug("Set package %(name)s folder to %(folder)s" % {"name": name, "folder": folder})
if self.pyfile.package().password:
self.core.api.setPackageData(pid, {"password": self.pyfile.package().password})