diff options
author | spoob <spoob@gmx.de> | 2009-12-03 23:33:46 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-12-03 23:33:46 +0100 |
commit | f98a9eea978ccf56d41f4ce355f2b514fc9e4af1 (patch) | |
tree | 1cb7e115b3d6f7053ef057cb7e84e9279b1d9601 /module/plugins/LinkList.py | |
parent | base for new gui (diff) | |
download | pyload-f98a9eea978ccf56d41f4ce355f2b514fc9e4af1.tar.xz |
Convert read_url_list to new Plugin
Diffstat (limited to 'module/plugins/LinkList.py')
-rw-r--r-- | module/plugins/LinkList.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py new file mode 100644 index 000000000..e496f2a57 --- /dev/null +++ b/module/plugins/LinkList.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class LinkList(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LinkList" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.txt" + props['version'] = "0.1" + props['description'] = """Read Link Lists in txt format""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, linkList, location): + tmpLinks = [] + txt = open(linkList, 'r') + links = txt.readlines() + for link in links: + if link != "\n": + tmpLinks.append(link) + txt.close() + + txt = open(linkList, 'w') + txt.write("") + txt.close() + #may delete read txt file? + + self.links = tmpLinks |