From 08a68abef700eb889cc560616e4b19bc2f813fd2 Mon Sep 17 00:00:00 2001 From: samson0v Date: Tue, 24 Jan 2023 18:35:05 +0200 Subject: [PATCH] Added entrypoint for Gateway Shell --- setup.py | 5 +++-- thingsboard_gateway/gateway/shell/shell.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 654d9bfb..4decb013 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ setup( include_package_data=True, python_requires=">=3.7", packages=['thingsboard_gateway', 'thingsboard_gateway.gateway', 'thingsboard_gateway.gateway.proto', 'thingsboard_gateway.gateway.grpc_service', - 'thingsboard_gateway.storage', 'thingsboard_gateway.storage.memory', + 'thingsboard_gateway.storage', 'thingsboard_gateway.storage.memory', 'thingsboard_gateway.gateway.shell', 'thingsboard_gateway.storage.file', 'thingsboard_gateway.storage.sqlite', 'thingsboard_gateway.connectors', 'thingsboard_gateway.connectors.ble', 'thingsboard_gateway.connectors.socket', 'thingsboard_gateway.connectors.mqtt', 'thingsboard_gateway.connectors.opcua_asyncio', 'thingsboard_gateway.connectors.xmpp', @@ -72,6 +72,7 @@ setup( entry_points={ 'console_scripts': [ 'thingsboard-gateway = thingsboard_gateway.tb_gateway:daemon', - 'tb-gateway-configurator = thingsboard_gateway.gateway.configuration_wizard:configure' + 'tb-gateway-configurator = thingsboard_gateway.gateway.configuration_wizard:configure', + 'tb-gateway-shell = thingsboard_gateway.gateway.shell:main' ] }) diff --git a/thingsboard_gateway/gateway/shell/shell.py b/thingsboard_gateway/gateway/shell/shell.py index a70cfd78..e04924a3 100644 --- a/thingsboard_gateway/gateway/shell/shell.py +++ b/thingsboard_gateway/gateway/shell/shell.py @@ -211,5 +211,9 @@ class Shell(cmd.Cmd, Thread): return self.do_exit(args) +def main(): + Shell() + + if __name__ == '__main__': shell = Shell()