change config specifiers in input file format

Instead of a dictionary/object, input file options are now specified
by a 'key=value' pair starting with '-' for options only applying to
the next URL or '-G' for Global options applying to all following URLs.

See the docstring of parse_inputfile() for details.

Example option specifiers:

- filename = "{id}.{extension}"
- extractor.pixiv.user.directory = ["Pixiv Users", "{user[id]}"]
-spaces="are_optional"
-G keywords = {"global": "option"}
This commit is contained in:
Mike Fährmann
2018-02-15 21:15:33 +01:00
parent f970a8f13c
commit b50bdbf3d7
4 changed files with 99 additions and 45 deletions

View File

@@ -261,10 +261,9 @@ class ChainPredicate():
class ExtendedUrl():
"""URL with attached config dict"""
def __init__(self, url, confdict):
self.value = url
self.config = confdict
"""URL with attached config key-value pairs"""
def __init__(self, url, gconf, lconf):
self.value, self.gconfig, self.lconfig = url, gconf, lconf
def __str__(self):
return self.value