From 29653fc04b821af50f3b95701ef9ccc344fde303 Mon Sep 17 00:00:00 2001 From: Albrecht Muehlenschulte Date: Fri, 6 May 2022 12:43:33 +0200 Subject: [PATCH] adds script --- matrix_webhook/__main__.py | 7 ++++++- pyproject.toml | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/matrix_webhook/__main__.py b/matrix_webhook/__main__.py index da99dcc..ff32a7b 100644 --- a/matrix_webhook/__main__.py +++ b/matrix_webhook/__main__.py @@ -3,7 +3,12 @@ import logging from . import app, conf -if __name__ == "__main__": + +def main(): log_format = "%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s" logging.basicConfig(level=50 - 10 * conf.VERBOSE, format=log_format) app.run() + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index f929ad2..2896dc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,3 +27,6 @@ ignore = ["D200", "D203", "D204", "D212"] [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +matrix-webhook = "matrix_webhook.__main__:main"