diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-14 14:08:38 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-14 14:08:38 +0100 |
commit | ed3b4cd5e100b5df44b45c55a00d49b208cb0a11 (patch) | |
tree | 5f1a9ea5ae0cc7507413aeb707a92c277ada7e65 /module/plugins/container | |
parent | prevent more than one pyload instance, -q, --quit option (diff) | |
download | pyload-ed3b4cd5e100b5df44b45c55a00d49b208cb0a11.tar.xz |
LinkList fix, update fix, crypter fix
Diffstat (limited to 'module/plugins/container')
-rw-r--r-- | module/plugins/container/LinkList.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py index d352d0b49..2bbe905c1 100644 --- a/module/plugins/container/LinkList.py +++ b/module/plugins/container/LinkList.py @@ -6,18 +6,18 @@ from module.plugins.Container import Container class LinkList(Container): __name__ = "LinkList" - __version__ = "0.1" - __pattern__ = r".*\.txt$" + __version__ = "0.11" + __pattern__ = r".+\.txt$" __description__ = """Read Link Lists in txt format""" + __config__ = [("clear", "Clear LinkList", "bool", True)] __author_name__ = ("spoob", "jeix") __author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com") def decrypt(self, pyfile): - txt = open(pyfile.url, 'r') links = txt.readlines() - curPack = "Parsed links %s" % pyfile.name + curPack = "Parsed links from %s" % pyfile.name packages = {curPack:[],} @@ -46,11 +46,13 @@ class LinkList(Container): for key in delete: del packages[key] - if not self.core.debug: - txt = open(linkList, 'w') - txt.write("") - txt.close() - #@TODO: maybe delete read txt file? + if self.getConfig("clear"): + try: + txt = open(pyfile.url, 'wb') + txt.write("") + txt.close() + except: + self.log.warning(_("LinkList could not be cleared.")) for name, links in packages.iteritems(): self.packages.append((name, links, name)) |