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"