ensure that section names do not include the protocol
This commit is contained in:
parent
7c8294bf49
commit
350f6d6f66
2 changed files with 6 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "brewserverblocklist"
|
name = "brewserverblocklist"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
description = "A python script to collect the server-wide blocklists from Friendica nodes to build a collection from trusted admin choice"
|
description = "A python script to collect the server-wide blocklists from Friendica nodes to build a collection from trusted admin choice"
|
||||||
authors = ["Tobias Diekershoff"]
|
authors = ["Tobias Diekershoff"]
|
||||||
license = "GNU General Public License v3.0"
|
license = "GNU General Public License v3.0"
|
||||||
|
|
|
@ -36,7 +36,11 @@ class BrewBlocklist():
|
||||||
config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
config.read(configfile)
|
config.read(configfile)
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
|
print(section)
|
||||||
section_values = dict(config.items(section))
|
section_values = dict(config.items(section))
|
||||||
|
if (section.find('http://') > -1) or (section.find('https://') > -1):
|
||||||
|
print('The section name in the config file must not contain the protocol ({})'.format(section))
|
||||||
|
sys.exit(1)
|
||||||
if not section == 'safe harbor':
|
if not section == 'safe harbor':
|
||||||
if not 'type' in section_values.keys():
|
if not 'type' in section_values.keys():
|
||||||
section_values['type'] = 'friendica'
|
section_values['type'] = 'friendica'
|
||||||
|
@ -181,7 +185,7 @@ def main():
|
||||||
arg_auto_accept = not args.auto_accept_direction is None
|
arg_auto_accept = not args.auto_accept_direction is None
|
||||||
if not exists(args.configfile):
|
if not exists(args.configfile):
|
||||||
print('The config file {} was not found.'.format(args.configfile))
|
print('The config file {} was not found.'.format(args.configfile))
|
||||||
sys.exit()
|
sys.exit(1)
|
||||||
brew = BrewBlocklist(args.configfile, args.outputfile, arg_auto_accept,
|
brew = BrewBlocklist(args.configfile, args.outputfile, arg_auto_accept,
|
||||||
args.auto_accept_direction, args.confidence)
|
args.auto_accept_direction, args.confidence)
|
||||||
brew.collect_ingrediens()
|
brew.collect_ingrediens()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue