From 0c2c0917b2a38cba7dd5f70b71e80c2846c45e22 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Thu, 23 Feb 2023 10:26:44 +0100 Subject: [PATCH] Directory structure and filename refactoring. (0.20.5) --- .editorconfig | 90 +++++++++++++++++++ AUTHORS.txt => AUTHORS | 0 CHANGELOG.txt => CHANGELOG | 0 LICENSE.txt => LICENSE | 0 Makefile | 1 - TODO.txt => TODO | 0 bin/linspector | 16 ++-- bin/lish | 13 ++- bin/litui | 2 +- etc.dev/linspector.conf | 2 +- linspector/{core => }/configuration.py | 2 +- linspector/core/__init__.py | 0 linspector/{core => }/environment.py | 2 +- linspector/{core => }/linspector.py | 2 +- linspector/{core => }/linspectord.py | 2 +- linspector/{core => }/logger.py | 2 +- linspector/{core => }/model.py | 2 +- linspector/{core => }/monitor.py | 2 +- linspector/{core => }/monitors.py | 4 +- linspector/{core => }/notification.py | 2 +- linspector/notifications/call.py | 4 +- linspector/notifications/email.py | 4 +- linspector/notifications/sms.py | 4 +- linspector/notifications/twitter.py | 4 +- linspector/notifications/xmpp.py | 4 +- linspector/{core => }/plugin.py | 2 +- linspector/plugins/api.py | 5 +- linspector/plugins/httpd.py | 4 +- linspector/plugins/lish.py | 4 +- linspector/plugins/rpc.py | 4 +- linspector/{core => }/service.py | 2 +- linspector/services/http/httpconnect.py | 4 +- linspector/services/http/httpkeyword.py | 4 +- linspector/services/misc/dummy.py | 4 +- linspector/services/misc/random.py | 4 +- linspector/services/net/ping.py | 4 +- linspector/services/net/port.py | 4 +- linspector/services/net/speedtest.py | 4 +- linspector/services/net/ssh.py | 4 +- linspector/services/net/tcpconnect.py | 4 +- linspector/services/snmp/get.py | 4 +- linspector/services/sys/shell.py | 2 +- linspector/services/sys/uptime.py | 2 +- .../services/vendor/avm/is_connected.py | 4 +- linspector/{core => }/singleton.py | 2 +- linspector/{core => }/task.py | 4 +- linspector/tasks/csv.py | 4 +- linspector/tasks/file.py | 4 +- linspector/tasks/mariadb.py | 4 +- linspector/tasks/redis.py | 4 +- linspector/tasks/splunk.py | 4 +- linspector/tasks/sqlite.py | 4 +- linspector/tasks/syslog.py | 4 +- 53 files changed, 177 insertions(+), 90 deletions(-) create mode 100644 .editorconfig rename AUTHORS.txt => AUTHORS (100%) rename CHANGELOG.txt => CHANGELOG (100%) rename LICENSE.txt => LICENSE (100%) rename TODO.txt => TODO (100%) rename linspector/{core => }/configuration.py (99%) delete mode 100644 linspector/core/__init__.py rename linspector/{core => }/environment.py (98%) rename linspector/{core => }/linspector.py (99%) rename linspector/{core => }/linspectord.py (99%) rename linspector/{core => }/logger.py (99%) rename linspector/{core => }/model.py (94%) rename linspector/{core => }/monitor.py (99%) rename linspector/{core => }/monitors.py (97%) rename linspector/{core => }/notification.py (92%) rename linspector/{core => }/plugin.py (92%) rename linspector/{core => }/service.py (91%) rename linspector/{core => }/singleton.py (98%) rename linspector/{core => }/task.py (97%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3865e5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,90 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = false +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[{*.py,*.pyw}] +max_line_length = 100 +ij_python_align_collections_and_comprehensions = true +ij_python_align_multiline_imports = true +ij_python_align_multiline_parameters = true +ij_python_align_multiline_parameters_in_calls = true +ij_python_blank_line_at_file_end = true +ij_python_blank_lines_after_imports = 1 +ij_python_blank_lines_after_local_imports = 0 +ij_python_blank_lines_around_class = 1 +ij_python_blank_lines_around_method = 1 +ij_python_blank_lines_around_top_level_classes_functions = 2 +ij_python_blank_lines_before_first_method = 0 +ij_python_call_parameters_new_line_after_left_paren = false +ij_python_call_parameters_right_paren_on_new_line = false +ij_python_call_parameters_wrap = normal +ij_python_dict_alignment = 0 +ij_python_dict_new_line_after_left_brace = false +ij_python_dict_new_line_before_right_brace = false +ij_python_dict_wrapping = 1 +ij_python_from_import_new_line_after_left_parenthesis = false +ij_python_from_import_new_line_before_right_parenthesis = false +ij_python_from_import_parentheses_force_if_multiline = false +ij_python_from_import_trailing_comma_if_multiline = false +ij_python_from_import_wrapping = 1 +ij_python_hang_closing_brackets = false +ij_python_keep_blank_lines_in_code = 1 +ij_python_keep_blank_lines_in_declarations = 1 +ij_python_keep_indents_on_empty_lines = false +ij_python_keep_line_breaks = true +ij_python_method_parameters_new_line_after_left_paren = false +ij_python_method_parameters_right_paren_on_new_line = false +ij_python_method_parameters_wrap = normal +ij_python_new_line_after_colon = false +ij_python_new_line_after_colon_multi_clause = true +ij_python_optimize_imports_always_split_from_imports = false +ij_python_optimize_imports_case_insensitive_order = false +ij_python_optimize_imports_join_from_imports_with_same_source = false +ij_python_optimize_imports_sort_by_type_first = true +ij_python_optimize_imports_sort_imports = true +ij_python_optimize_imports_sort_names_in_from_imports = false +ij_python_space_after_comma = true +ij_python_space_after_number_sign = true +ij_python_space_after_py_colon = true +ij_python_space_before_backslash = true +ij_python_space_before_comma = false +ij_python_space_before_for_semicolon = false +ij_python_space_before_lbracket = false +ij_python_space_before_method_call_parentheses = false +ij_python_space_before_method_parentheses = false +ij_python_space_before_number_sign = true +ij_python_space_before_py_colon = false +ij_python_space_within_empty_method_call_parentheses = false +ij_python_space_within_empty_method_parentheses = false +ij_python_spaces_around_additive_operators = true +ij_python_spaces_around_assignment_operators = true +ij_python_spaces_around_bitwise_operators = true +ij_python_spaces_around_eq_in_keyword_argument = false +ij_python_spaces_around_eq_in_named_parameter = false +ij_python_spaces_around_equality_operators = true +ij_python_spaces_around_multiplicative_operators = true +ij_python_spaces_around_power_operator = true +ij_python_spaces_around_relational_operators = true +ij_python_spaces_around_shift_operators = true +ij_python_spaces_within_braces = false +ij_python_spaces_within_brackets = false +ij_python_spaces_within_method_call_parentheses = false +ij_python_spaces_within_method_parentheses = false +ij_python_use_continuation_indent_for_arguments = false +ij_python_use_continuation_indent_for_collection_and_comprehensions = false +ij_python_use_continuation_indent_for_parameters = true +ij_python_wrap_long_lines = false diff --git a/AUTHORS.txt b/AUTHORS similarity index 100% rename from AUTHORS.txt rename to AUTHORS diff --git a/CHANGELOG.txt b/CHANGELOG similarity index 100% rename from CHANGELOG.txt rename to CHANGELOG diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/Makefile b/Makefile index 0f7f5d8..6bc4d74 100644 --- a/Makefile +++ b/Makefile @@ -38,4 +38,3 @@ run: daemon: PYTHONPATH=$(shell pwd):$(shell pwd)/venv/lib/python$(PYTHON_VRESION)/site-packages/ bin/linspector -d ./etc - diff --git a/TODO.txt b/TODO similarity index 100% rename from TODO.txt rename to TODO diff --git a/bin/linspector b/bin/linspector index af1e589..b7e10f4 100755 --- a/bin/linspector +++ b/bin/linspector @@ -2,7 +2,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ # TODO: VERY IMPORTANT! IMPLEMENT ERROR HANDLING ALL THE WAY...!!! # Only exit execution on critical core errors. Do not exit when monitors are failing on @@ -11,13 +11,13 @@ import argparse import signal import sys -from linspector.core.configuration import Configuration -from linspector.core.environment import Environment -from linspector.core.linspector import Linspector -from linspector.core.logger import Log -from linspector.core.monitors import Monitors +from linspector.configuration import Configuration +from linspector.environment import Environment +from linspector.linspector import Linspector +from linspector.logger import Log +from linspector.monitors import Monitors -__version__ = '0.20.4' +__version__ = '0.20.5' __author__ = 'Johannes Findeisen ' @@ -85,7 +85,7 @@ def main(): # daemon initialization if args.daemon: try: - from linspector.core.linspectord import Linspectord + from linspector.linspectord import Linspectord linspectord = Linspectord(configuration, environment, linspector, log) # do handling of restart, start and stop commands but for now "start" is enough... ;) if args.kill: diff --git a/bin/lish b/bin/lish index 792c039..c9af5fd 100755 --- a/bin/lish +++ b/bin/lish @@ -2,7 +2,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ # TODO: Make use of the "rich" library to for rich text and beautiful formatting in the terminal. import argparse @@ -14,11 +14,10 @@ import logging.handlers import os import sys -from linspector.core.configuration import Configuration -from linspector.core.environment import Environment -from linspector.core.linspector import Linspector -from linspector.core.logger import Log -from linspector.core.monitors import Monitors +from linspector.configuration import Configuration +from linspector.environment import Environment +from linspector.linspector import Linspector +from linspector.monitors import Monitors logger = logging.getLogger('linspector') @@ -146,7 +145,7 @@ def main(): # daemon initialization if args.daemon: try: - from linspector.core.linspectord import Linspectord + from linspector.linspectord import Linspectord linspectord = Linspectord(configuration, environment, linspector, log) # do handling of restart, start and stop commands but for now "start" is enough... ;) if args.kill: diff --git a/bin/litui b/bin/litui index e26c513..ad19a22 100644 --- a/bin/litui +++ b/bin/litui @@ -2,7 +2,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt for more details. +See LICENSE for more details. """ # TODO: Make this a curses style TUI interface for Linspector using urwid or maybe some more modern # framework like textual. Look at the Lish code for more details about backend implementation and diff --git a/etc.dev/linspector.conf b/etc.dev/linspector.conf index 6e43bb2..f4dbf11 100644 --- a/etc.dev/linspector.conf +++ b/etc.dev/linspector.conf @@ -56,7 +56,7 @@ timezone = CET ; development only. delta_range = 60 -; hostgroup parents; if the hostgroup "group1" is down, don't alert for the hosts in group2. see TODO.txt for more +; hostgroup parents; if the hostgroup "group1" is down, don't alert for the hosts in group2. see TODO for more ; information. [hostgroupparents] ; hostgroup group1 is parent of group2 diff --git a/linspector/core/configuration.py b/linspector/configuration.py similarity index 99% rename from linspector/core/configuration.py rename to linspector/configuration.py index e6cb83d..631fe9c 100644 --- a/linspector/core/configuration.py +++ b/linspector/configuration.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import configparser import glob diff --git a/linspector/core/__init__.py b/linspector/core/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/linspector/core/environment.py b/linspector/environment.py similarity index 98% rename from linspector/core/environment.py rename to linspector/environment.py index be38211..eee61fe 100644 --- a/linspector/core/environment.py +++ b/linspector/environment.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/core/linspector.py b/linspector/linspector.py similarity index 99% rename from linspector/core/linspector.py rename to linspector/linspector.py index e7a8fe5..61c5a7a 100644 --- a/linspector/core/linspector.py +++ b/linspector/linspector.py @@ -2,7 +2,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import datetime import importlib diff --git a/linspector/core/linspectord.py b/linspector/linspectord.py similarity index 99% rename from linspector/core/linspectord.py rename to linspector/linspectord.py index 0b98f4b..6f44b59 100644 --- a/linspector/core/linspectord.py +++ b/linspector/linspectord.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import atexit import os diff --git a/linspector/core/logger.py b/linspector/logger.py similarity index 99% rename from linspector/core/logger.py rename to linspector/logger.py index 656922f..428230c 100644 --- a/linspector/core/logger.py +++ b/linspector/logger.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import logging import os diff --git a/linspector/core/model.py b/linspector/model.py similarity index 94% rename from linspector/core/model.py rename to linspector/model.py index e597553..8c92508 100644 --- a/linspector/core/model.py +++ b/linspector/model.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/core/monitor.py b/linspector/monitor.py similarity index 99% rename from linspector/core/monitor.py rename to linspector/monitor.py index 14063a5..e40a910 100644 --- a/linspector/core/monitor.py +++ b/linspector/monitor.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import configparser import importlib diff --git a/linspector/core/monitors.py b/linspector/monitors.py similarity index 97% rename from linspector/core/monitors.py rename to linspector/monitors.py index 44514cd..01bff17 100644 --- a/linspector/core/monitors.py +++ b/linspector/monitors.py @@ -1,13 +1,13 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import configparser import glob import os -from linspector.core.monitor import Monitor +from linspector.monitor import Monitor # monitors may must / should be added (and maybe changed) at runtime to add new monitors without diff --git a/linspector/core/notification.py b/linspector/notification.py similarity index 92% rename from linspector/core/notification.py rename to linspector/notification.py index 229b2ef..ea4ed32 100644 --- a/linspector/core/notification.py +++ b/linspector/notification.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/notifications/call.py b/linspector/notifications/call.py index 689156a..deb906a 100644 --- a/linspector/notifications/call.py +++ b/linspector/notifications/call.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.notification import Notification +from linspector.notification import Notification def create(configuration, environment, log): diff --git a/linspector/notifications/email.py b/linspector/notifications/email.py index ff9bc10..d033ca9 100644 --- a/linspector/notifications/email.py +++ b/linspector/notifications/email.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.notification import Notification +from linspector.notification import Notification def create(configuration, environment, log): diff --git a/linspector/notifications/sms.py b/linspector/notifications/sms.py index f78838f..325d2b1 100644 --- a/linspector/notifications/sms.py +++ b/linspector/notifications/sms.py @@ -1,10 +1,10 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.notification import Notification +from linspector.notification import Notification def create(configuration, environment, log): diff --git a/linspector/notifications/twitter.py b/linspector/notifications/twitter.py index ef42f07..1858615 100644 --- a/linspector/notifications/twitter.py +++ b/linspector/notifications/twitter.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.notification import Notification +from linspector.notification import Notification def create(configuration, environment, log): diff --git a/linspector/notifications/xmpp.py b/linspector/notifications/xmpp.py index 7950ef2..b398a65 100644 --- a/linspector/notifications/xmpp.py +++ b/linspector/notifications/xmpp.py @@ -1,10 +1,10 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.notification import Notification +from linspector.notification import Notification def create(configuration, environment, log): diff --git a/linspector/core/plugin.py b/linspector/plugin.py similarity index 92% rename from linspector/core/plugin.py rename to linspector/plugin.py index f73be74..a0d82cd 100644 --- a/linspector/core/plugin.py +++ b/linspector/plugin.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/plugins/api.py b/linspector/plugins/api.py index 6de93a5..bd2a6c8 100644 --- a/linspector/plugins/api.py +++ b/linspector/plugins/api.py @@ -1,13 +1,12 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ # TODO: Make this a backend API using the modern FastAPI framework as a replacement for the # traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by # the Lish but I believe it makes sense to only create one backend for all clients. -from fastapi import FastAPI -from linspector.core.plugin import Plugin +from linspector.plugin import Plugin def create(configuration, environment, linspector, log): diff --git a/linspector/plugins/httpd.py b/linspector/plugins/httpd.py index 678b5e2..a5e43ae 100644 --- a/linspector/plugins/httpd.py +++ b/linspector/plugins/httpd.py @@ -1,13 +1,13 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import json import cherrypy -from linspector.core.plugin import Plugin +from linspector.plugin import Plugin def create(configuration, environment, linspector, log): diff --git a/linspector/plugins/lish.py b/linspector/plugins/lish.py index 3b91b92..32064b2 100644 --- a/linspector/plugins/lish.py +++ b/linspector/plugins/lish.py @@ -1,12 +1,12 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ # TODO: This plugin should become the internal Lish implemented as a plugin which does not use the # API plugin but loads at the end when starting Linspector in interactive mode as a terminal like # interface to the core of Linspector. -from linspector.core.plugin import Plugin +from linspector.plugin import Plugin def create(configuration, environment, linspector, log): diff --git a/linspector/plugins/rpc.py b/linspector/plugins/rpc.py index 9903bf8..dd322f5 100644 --- a/linspector/plugins/rpc.py +++ b/linspector/plugins/rpc.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.plugin import Plugin +from linspector.plugin import Plugin def create(configuration, environment, linspector, log): diff --git a/linspector/core/service.py b/linspector/service.py similarity index 91% rename from linspector/core/service.py rename to linspector/service.py index 9d5e9c4..f70829a 100644 --- a/linspector/core/service.py +++ b/linspector/service.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/services/http/httpconnect.py b/linspector/services/http/httpconnect.py index 3e13181..d43e8a8 100644 --- a/linspector/services/http/httpconnect.py +++ b/linspector/services/http/httpconnect.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/http/httpkeyword.py b/linspector/services/http/httpkeyword.py index d4d328f..f9564d8 100644 --- a/linspector/services/http/httpkeyword.py +++ b/linspector/services/http/httpkeyword.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/misc/dummy.py b/linspector/services/misc/dummy.py index 3150cb9..54765df 100644 --- a/linspector/services/misc/dummy.py +++ b/linspector/services/misc/dummy.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/misc/random.py b/linspector/services/misc/random.py index 4f787c8..976b10c 100644 --- a/linspector/services/misc/random.py +++ b/linspector/services/misc/random.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/net/ping.py b/linspector/services/net/ping.py index c2c1026..ec23954 100644 --- a/linspector/services/net/ping.py +++ b/linspector/services/net/ping.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/net/port.py b/linspector/services/net/port.py index d6e6105..e9b58b1 100644 --- a/linspector/services/net/port.py +++ b/linspector/services/net/port.py @@ -1,11 +1,11 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import socket -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/net/speedtest.py b/linspector/services/net/speedtest.py index 834a26e..ae39f38 100644 --- a/linspector/services/net/speedtest.py +++ b/linspector/services/net/speedtest.py @@ -1,14 +1,14 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import calendar import time import requests -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/net/ssh.py b/linspector/services/net/ssh.py index 522590e..f0f745a 100644 --- a/linspector/services/net/ssh.py +++ b/linspector/services/net/ssh.py @@ -1,14 +1,14 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ import os import pprint import paramiko -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/net/tcpconnect.py b/linspector/services/net/tcpconnect.py index 7e03f74..2c9e909 100644 --- a/linspector/services/net/tcpconnect.py +++ b/linspector/services/net/tcpconnect.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/snmp/get.py b/linspector/services/snmp/get.py index ed7fbdc..27e59f2 100644 --- a/linspector/services/snmp/get.py +++ b/linspector/services/snmp/get.py @@ -1,10 +1,10 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/sys/shell.py b/linspector/services/sys/shell.py index ed54ba2..7e961ed 100644 --- a/linspector/services/sys/shell.py +++ b/linspector/services/sys/shell.py @@ -3,7 +3,7 @@ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. See LICENSE (MIT license) """ -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/services/sys/uptime.py b/linspector/services/sys/uptime.py index 74d1202..bf1bc7b 100644 --- a/linspector/services/sys/uptime.py +++ b/linspector/services/sys/uptime.py @@ -3,7 +3,7 @@ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. See LICENSE (MIT license) """ -from linspector.core.service import Service +from linspector.service import Service def get(configuration, environment, log): diff --git a/linspector/services/vendor/avm/is_connected.py b/linspector/services/vendor/avm/is_connected.py index 2fbdbaf..4f0e820 100644 --- a/linspector/services/vendor/avm/is_connected.py +++ b/linspector/services/vendor/avm/is_connected.py @@ -1,11 +1,11 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ from fritzconnection.lib.fritzstatus import FritzStatus -from linspector.core.service import Service +from linspector.service import Service def create(configuration, environment, log): diff --git a/linspector/core/singleton.py b/linspector/singleton.py similarity index 98% rename from linspector/core/singleton.py rename to linspector/singleton.py index 62538a0..c55da79 100644 --- a/linspector/core/singleton.py +++ b/linspector/singleton.py @@ -1,7 +1,7 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ diff --git a/linspector/core/task.py b/linspector/task.py similarity index 97% rename from linspector/core/task.py rename to linspector/task.py index 1e14b45..080192e 100644 --- a/linspector/core/task.py +++ b/linspector/task.py @@ -1,12 +1,12 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ from queue import Queue from threading import Thread -from linspector.core.singleton import Singleton +from linspector.singleton import Singleton KEY_TYPE = "type" KEY_ARGS = "args" diff --git a/linspector/tasks/csv.py b/linspector/tasks/csv.py index eafcaeb..87727ac 100644 --- a/linspector/tasks/csv.py +++ b/linspector/tasks/csv.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/file.py b/linspector/tasks/file.py index 40e1662..ab0b19b 100644 --- a/linspector/tasks/file.py +++ b/linspector/tasks/file.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/mariadb.py b/linspector/tasks/mariadb.py index a62829a..4d572ce 100644 --- a/linspector/tasks/mariadb.py +++ b/linspector/tasks/mariadb.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/redis.py b/linspector/tasks/redis.py index 0e8e7fc..248ebd7 100644 --- a/linspector/tasks/redis.py +++ b/linspector/tasks/redis.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/splunk.py b/linspector/tasks/splunk.py index bc3b6d7..73766bb 100644 --- a/linspector/tasks/splunk.py +++ b/linspector/tasks/splunk.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/sqlite.py b/linspector/tasks/sqlite.py index 725d7d6..4d9b8bf 100644 --- a/linspector/tasks/sqlite.py +++ b/linspector/tasks/sqlite.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2022 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log): diff --git a/linspector/tasks/syslog.py b/linspector/tasks/syslog.py index 7cb8f84..e067b1c 100644 --- a/linspector/tasks/syslog.py +++ b/linspector/tasks/syslog.py @@ -1,9 +1,9 @@ """ This file is part of Linspector (https://linspector.org/) Copyright (c) 2023 Johannes Findeisen . All Rights Reserved. -See LICENSE.txt (MIT license). +See LICENSE (MIT license). """ -from linspector.core.task import Task +from linspector.task import Task def create(configuration, environment, log):