From 08e712c085fe6d20b38cade13198d5d81b419b82 Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Sun, 11 Apr 2021 23:27:03 -0400 Subject: [PATCH] Added User Module to Main --- config.py | 6 ++++-- main.py | 15 ++++++++++++++- run.bat | 1 - user_module.py | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 run.bat diff --git a/config.py b/config.py index 53e8eec..cd67c70 100644 --- a/config.py +++ b/config.py @@ -5,8 +5,8 @@ credentialsNickname = "praxis_bot" twitch_module: bool = False discord_module: bool = False - test_module: bool = False +user_module: bool = True autoJoin_TwitchChannels = ["thecuriousnerd"] whitelisted_TwitchPowerUsers = ["thecuriousnerd"] @@ -41,10 +41,12 @@ blockAll_TTS_URL_Discord = True autoEnabled_Discord_rgbLightControl = False +#User Module Configs +blockAll_TTS_URL_UserModule = True + #Chyron Module Configs chyronListSpaceCount = 25 - #Lights Module Configs colorParse_maxDigits = 4 diff --git a/main.py b/main.py index d0f72ac..f9a47c4 100644 --- a/main.py +++ b/main.py @@ -6,9 +6,10 @@ import time import twitch_script import discord_script - import test_module +import user_module + import utilities_script as utility import config as config @@ -19,6 +20,7 @@ import threading twitchModule_: twitch_script.Twitch_Module discordModule_: discord_script.Discord_Module testModule_: test_module.Test_Module +userModule_: user_module.User_Module credentials_manager: credentials.Credentials_Module @@ -55,6 +57,10 @@ def test_module_init(dbCert, Empty): #testModule_.dbCredential = dbCert testModule_.main() +def user_module_init(dbCert, Empty): + print("-init [USER Module]") + userModule_.dbCredential = dbCert + userModule_.main() def thread_main(): if not config.skip_splashScreen: @@ -63,12 +69,14 @@ def thread_main(): global twitchModule_ global discordModule_ global testModule_ + global userModule_ credentials_manager = credentials.Credentials_Module() twitchModule_ = twitch_script.Twitch_Module() discordModule_ = discord_script.Discord_Module() testModule_ = test_module.Test_Module() + userModule_ = user_module.User_Module() credentials_manager.load_credentials() dbCert: credentials.DB_Credential = credentials_manager.find_Credential(credentials.DB_Credential, config.credentialsNickname) @@ -91,6 +99,11 @@ def thread_main(): threads.append(thread_) thread_.start() + if config.user_module == True: + thread_ = threading.Thread(target=user_module_init, args=(dbCert, None)) + threads.append(thread_) + thread_.start() + print("---Post Thread Creation Test---") for t in threads: t.join() diff --git a/run.bat b/run.bat deleted file mode 100644 index caee662..0000000 --- a/run.bat +++ /dev/null @@ -1 +0,0 @@ -python "c:/Praxis/main.py" \ No newline at end of file diff --git a/user_module.py b/user_module.py index 45945dc..7891130 100644 --- a/user_module.py +++ b/user_module.py @@ -25,7 +25,7 @@ class User_Module(): message.makeMessage(message=keyboardInput) if "exit" in keyboardInput: - print("Quitting User Module Interface...") + print("Quitting [User Module] Interface...") inputLoop = False break