added module bargparse to the project

This commit is contained in:
Tobias Diekershoff 2023-01-14 11:44:06 +01:00
parent c230c64680
commit 423897a9a3
3 changed files with 14 additions and 2 deletions

View file

@ -5,6 +5,13 @@ description = "A python script to collect the server-wide blocklists from Friend
authors = ["Tobias Diekershoff"] authors = ["Tobias Diekershoff"]
license = "GNU General Public License v3.0" license = "GNU General Public License v3.0"
readme = "README.md" readme = "README.md"
include = [
{ path = "src/brewserverblocklist" },
]
packages = [
{ include = "brewserverblocklist", from = "src"},
{ include = "bargparse", from = "src"}
]
[tool.poetry.scripts] [tool.poetry.scripts]
brewserverblocklist = "brewserverblocklist.brewserverblocklist:main" brewserverblocklist = "brewserverblocklist.brewserverblocklist:main"

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2023 Tobias Diekershoff
#
# SPDX-License-Identifier: GPL-3.0-or-later

View file

@ -12,7 +12,7 @@ import configparser
import sys import sys
from os.path import exists from os.path import exists
import requests import requests
import bargparse from bargparse.bargparse import MyParser
class BrewBlocklist(): class BrewBlocklist():
""" """
@ -157,7 +157,7 @@ def main():
* collect the ingredient * collect the ingredient
* serve the result * serve the result
""" """
parser = bargparse.MyParser() parser = MyParser()
parser.add_argument('-c', '--config', parser.add_argument('-c', '--config',
dest='configfile', dest='configfile',
required=True, required=True,