extend input-file format with per-URL config and comments

- see docstring of parse_inputfile() for details
- TODO: unittests, recursion (currently setting for example
  {"extractor": {"key": "value"}} will override the whole "extractor"
  branch instead of merging {"key": "value"} into the already existing
  dictionary)
This commit is contained in:
Mike Fährmann
2018-02-07 21:47:27 +01:00
parent 5b3c34aa96
commit 057668e17e
3 changed files with 91 additions and 13 deletions

View File

@@ -259,6 +259,16 @@ class ChainPredicate():
return True
class ExtendedUrl():
"""URL with attached config dict"""
def __init__(self, url, confdict):
self.value = url
self.config = confdict
def __str__(self):
return self.value
class Formatter():
"""Custom, trimmed-down version of string.Formatter