From 52e327528ad0f9f12951b703638485444b7e923c Mon Sep 17 00:00:00 2001 From: 0x7878 <17197791+0x7878@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:22:05 +0000 Subject: [PATCH] Refactor code to remove unused paths --- dbus_opendtu.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbus_opendtu.py b/dbus_opendtu.py index 2790a7c..2d399ff 100644 --- a/dbus_opendtu.py +++ b/dbus_opendtu.py @@ -4,14 +4,14 @@ from imports import * config = None -paths = None number_of_inverters = 0 number_of_templates = 0 + def initialize(): """ Initialize the module """ # pylint: disable=w0603 - global config, paths, number_of_inverters, number_of_templates + global config, number_of_inverters, number_of_templates # configure logging config = configparser.ConfigParser() @@ -38,7 +38,6 @@ def initialize(): number_of_templates = 0 - def register_service(): """ Register the service """ global number_of_inverters @@ -86,6 +85,7 @@ def register_service(): istemplate=True, ) + def main(): """ Main function """ initialize() @@ -107,5 +107,6 @@ def main(): except Exception as error: logging.critical("Error at %s", "main", exc_info=error) + if __name__ == "__main__": main()