added over.app.ConfigFile.ignore_unknown
This commit is contained in:
parent
b4019f31d1
commit
89cbc24cbb
2 changed files with 7 additions and 3 deletions
|
@ -289,12 +289,13 @@ class ConfigFile:
|
||||||
- missing options are appended to the file
|
- missing options are appended to the file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, options, path):
|
def __init__(self, options, path, ignore_unknown=False):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.options = options
|
self.options = options
|
||||||
self.path = path
|
self.path = path
|
||||||
|
self.ignore_unknown = ignore_unknown
|
||||||
self.print = text.Output("over.app.ConfigFile")
|
self.print = text.Output("over.app.ConfigFile")
|
||||||
self.seen_hashes = set()
|
self.seen_hashes = set()
|
||||||
|
|
||||||
|
@ -324,7 +325,10 @@ class ConfigFile:
|
||||||
try:
|
try:
|
||||||
option = self.options[L]
|
option = self.options[L]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise UnknownOption(L)
|
if self.ignore_unknown:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
raise UnknownOption(L)
|
||||||
|
|
||||||
args = shlex.split(R)
|
args = shlex.split(R)
|
||||||
option.set_value(args, Option_sources.config_file)
|
option.set_value(args, Option_sources.config_file)
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
major = 1 # VERSION_MAJOR_IDENTIFIER
|
major = 1 # VERSION_MAJOR_IDENTIFIER
|
||||||
minor = 99 # VERSION_MINOR_IDENTIFIER
|
minor = 99 # VERSION_MINOR_IDENTIFIER
|
||||||
# VERSION_LAST_MM 1.99
|
# VERSION_LAST_MM 1.99
|
||||||
patch = 6 # VERSION_PATCH_IDENTIFIER
|
patch = 7 # VERSION_PATCH_IDENTIFIER
|
||||||
str = ".".join(str(v) for v in (major, minor, patch))
|
str = ".".join(str(v) for v in (major, minor, patch))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue