diff --git a/Command_Management_Module.py b/Command_Management_Module.py index f8df757..29b365e 100644 --- a/Command_Management_Module.py +++ b/Command_Management_Module.py @@ -1,5 +1,5 @@ from main import user_module_init -import config as config +import config_management_module as config import db import user_module diff --git a/chyron_module.py b/chyron_module.py index 1eed58a..2cf3ce0 100644 --- a/chyron_module.py +++ b/chyron_module.py @@ -1,4 +1,4 @@ -import config +import config_management_module as config import utilities_script as utilities import os diff --git a/commands/implemented/command_threads.py b/commands/implemented/command_threads.py index 42bfa66..0f83965 100644 --- a/commands/implemented/command_threads.py +++ b/commands/implemented/command_threads.py @@ -3,7 +3,7 @@ import tempText_Module from commands.command_base import AbstractCommand -import thread_management_module +#import thread_management_module import utilities_script as utilities @@ -24,7 +24,7 @@ class Command_Threading(AbstractCommand, metaclass=ABCMeta): def do_command(self, bot, user_message): - thread_Module = thread_management_module() + #thread_Module = thread_management_module() tempBool = True if tempBool == True: tempParsedMessage = user_message.message.split(" ") diff --git a/config.py b/config.py deleted file mode 100644 index ee2fa26..0000000 --- a/config.py +++ /dev/null @@ -1,158 +0,0 @@ -from enum import Enum -import badwords as badwords - -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"] - -#Twitch Module Configs -block_TwitchChannelsMessaging = [""] # Blocks the ability to send messages to twitch channels -blockAll_TwitchChatChannelsMessaging = False # Blocks the ability to send messages to twitch channels - -autoEnabled_TwitchChannelsTTS = False -block_TwitchChannelsTTS = [""] # block supersedes the tts_enabled bool -blockAll_TwitchChatChannelsTTS = False # blockAll supersedes the force bool and force list and tts_enabled bool -force_TwitchChannelsTTS = [""] # force supersedes the block list -forceAll_TwitchChatChannelsTTS = False # forceAll supersedes the blockAll bool and block list and force list - -blockAll_TTS_URL_Twitch = True - -autoEnabled_Twitch_rgbLightControl = False - -twitch_defaultCommandEnabledState = True -#twitch_defaultCommandEnabledState_liveStreamOnly = True # If true this will make commands only available during live streams. - -#Discord Module Configs -block_DiscordChannelsMessaging = [""] # Blocks the ability to send messages to Discord channels -blockAll_DiscordChannelsMessaging = False # Blocks the ability to send messages to Discord channels -blockAll_DiscordPrivateMessaging = False # Private Messaging not yet implemented - -autoEnabled_DiscordChannelsTTS = False -selected_DiscordTTSChannels = ["431129571308339210"] -block_DiscordChannelsTTS = [""] # block supersedes the tts_enabled bool -blockAll_DiscordChannelsTTS = False # blockAll supersedes the force bool and force list and tts_enabled bool -force_DiscordChannelsTTS = [""] # force supersedes the block list -forceAll_DiscordChatChannelsTTS = False # forceAll supersedes the blockAll bool and block list and force list - -blockAll_TTS_URL_Discord = True - -autoEnabled_Discord_rgbLightControl = False - -#discord_defaultCommandEnabledState = True -#discord_defaultCommandEnabledState_liveStreamOnly = True # If true this will make commands only available during live streams. - -#User Module Configs -blockAll_TTS_URL_UserModule = True - -#Chyron Module Configs -chyronListSpaceCount = 25 - -#Lights Module Configs -colorParse_maxDigits = 4 - - -#General Configs -skip_splashScreen = False -skip_splashScreenClear = False -skip_splashScreenSleep = False - -botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") - -class FileNameStrategy(Enum): - TIME_BASED = 1 - CONTENT_BASED = 2 - -fileNameStrategy = FileNameStrategy.CONTENT_BASED - - -class DBStrategy(Enum): - SQLite = 1 - MySQL = 2 - -dbStrategy = DBStrategy.SQLite - - -#TTS Configs -class Speaker(Enum): - GOOGLE_TEXT_TO_SPEECH = 1 - STREAMLABS_API = 2 - -currentSpeaker = Speaker.GOOGLE_TEXT_TO_SPEECH - -class PollyVoices(Enum): - Aditi = "Aditi" - Amy = "Amy" - Astrid = "Astrid" - Bianca = "Bianca" - Brian = "Brian" - Camila = "Camila" - Carla = "Carla" - Carmen = "Carmen" - Celine = "Celine" - Chantal = "Chantal" - Conchita = "Conchita" - Cristiano = "Cristiano" - Dora = "Dora" - Emma = "Emma" - Enrique = "Enrique" - Ewa = "Ewa" - Filiz = "Filiz" - Geraint = "Geraint" - Giorgio = "Giorgio" - Gwyneth = "Gwyneth" - Hans = "Hans" - Ines = "Ines" - Ivy = "Ivy" - Jacek = "Jacek" - Jan = "Jan" - Joanna = "Joanna" - Joey = "Joey" - Justin = "Justin" - Karl = "Karl" - Kendra = "Kendra" - Kimberly = "Kimberly" - Lea = "Lea" - Liv = "Liv" - Lotte = "Lotte" - Lucia = "Lucia" - Lupe = "Lupe" - Mads = "Mads" - Maja = "Maja" - Marlene = "Marlene" - Mathieu = "Mathieu" - Matthew = "Matthew" - Maxim = "Maxim" - Mia = "Mia" - Miguel = "Miguel" - Mizuki = "Mizuki" - Naja = "Naja" - Nicole = "Nicole" - Penelope = "Penelope" - Raveena = "Raveena" - Ricardo = "Ricardo" - Ruben = "Ruben" - Russell = "Russell" - Salli = "Salli" - Seoyeon = "Seoyeon" - Takumi = "Takumi" - Tatyana = "Tatyana" - Vicki = "Vicki" - Vitoria = "Vitoria" - Zeina = "Zeina" - Zhiyu = "Zhiyu" - -PollyVoice = PollyVoices.Justin - - -#Misc Configs -slurList = badwords.slurList - -praxisVersion_Alpha = "A.0 " -praxisVersion_Delta = "D.1 " -praxisVersion_Omega = "O.0 " diff --git a/config__definitions.py b/config__definitions.py new file mode 100644 index 0000000..8670d82 --- /dev/null +++ b/config__definitions.py @@ -0,0 +1,77 @@ +from enum import Enum + +class FileNameStrategy(Enum): + TIME_BASED = 1 + CONTENT_BASED = 2 + + +class DBStrategy(Enum): + SQLite = 1 + MySQL = 2 + +#TTS Configs +class Speaker(Enum): + GOOGLE_TEXT_TO_SPEECH = 1 + STREAMLABS_API = 2 + +class PollyVoices(Enum): + Aditi = "Aditi" + Amy = "Amy" + Astrid = "Astrid" + Bianca = "Bianca" + Brian = "Brian" + Camila = "Camila" + Carla = "Carla" + Carmen = "Carmen" + Celine = "Celine" + Chantal = "Chantal" + Conchita = "Conchita" + Cristiano = "Cristiano" + Dora = "Dora" + Emma = "Emma" + Enrique = "Enrique" + Ewa = "Ewa" + Filiz = "Filiz" + Geraint = "Geraint" + Giorgio = "Giorgio" + Gwyneth = "Gwyneth" + Hans = "Hans" + Ines = "Ines" + Ivy = "Ivy" + Jacek = "Jacek" + Jan = "Jan" + Joanna = "Joanna" + Joey = "Joey" + Justin = "Justin" + Karl = "Karl" + Kendra = "Kendra" + Kimberly = "Kimberly" + Lea = "Lea" + Liv = "Liv" + Lotte = "Lotte" + Lucia = "Lucia" + Lupe = "Lupe" + Mads = "Mads" + Maja = "Maja" + Marlene = "Marlene" + Mathieu = "Mathieu" + Matthew = "Matthew" + Maxim = "Maxim" + Mia = "Mia" + Miguel = "Miguel" + Mizuki = "Mizuki" + Naja = "Naja" + Nicole = "Nicole" + Penelope = "Penelope" + Raveena = "Raveena" + Ricardo = "Ricardo" + Ruben = "Ruben" + Russell = "Russell" + Salli = "Salli" + Seoyeon = "Seoyeon" + Takumi = "Takumi" + Tatyana = "Tatyana" + Vicki = "Vicki" + Vitoria = "Vitoria" + Zeina = "Zeina" + Zhiyu = "Zhiyu" diff --git a/config_default.py b/config_default.py index 86b0f8b..6842334 100644 --- a/config_default.py +++ b/config_default.py @@ -1,6 +1,8 @@ from enum import Enum import badwords as badwords +import config__definitions + class Config_Default(): configName= "default" credentialsNickname = "praxis_bot" @@ -66,90 +68,17 @@ class Config_Default(): botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") - class FileNameStrategy(Enum): - TIME_BASED = 1 - CONTENT_BASED = 2 - fileNameStrategy = FileNameStrategy.CONTENT_BASED + fileNameStrategy = config__definitions.FileNameStrategy.CONTENT_BASED - class DBStrategy(Enum): - SQLite = 1 - MySQL = 2 - - dbStrategy = DBStrategy.SQLite + dbStrategy = config__definitions.DBStrategy.SQLite #TTS Configs - class Speaker(Enum): - GOOGLE_TEXT_TO_SPEECH = 1 - STREAMLABS_API = 2 + currentSpeaker = config__definitions.Speaker.GOOGLE_TEXT_TO_SPEECH - currentSpeaker = Speaker.GOOGLE_TEXT_TO_SPEECH - - class PollyVoices(Enum): - Aditi = "Aditi" - Amy = "Amy" - Astrid = "Astrid" - Bianca = "Bianca" - Brian = "Brian" - Camila = "Camila" - Carla = "Carla" - Carmen = "Carmen" - Celine = "Celine" - Chantal = "Chantal" - Conchita = "Conchita" - Cristiano = "Cristiano" - Dora = "Dora" - Emma = "Emma" - Enrique = "Enrique" - Ewa = "Ewa" - Filiz = "Filiz" - Geraint = "Geraint" - Giorgio = "Giorgio" - Gwyneth = "Gwyneth" - Hans = "Hans" - Ines = "Ines" - Ivy = "Ivy" - Jacek = "Jacek" - Jan = "Jan" - Joanna = "Joanna" - Joey = "Joey" - Justin = "Justin" - Karl = "Karl" - Kendra = "Kendra" - Kimberly = "Kimberly" - Lea = "Lea" - Liv = "Liv" - Lotte = "Lotte" - Lucia = "Lucia" - Lupe = "Lupe" - Mads = "Mads" - Maja = "Maja" - Marlene = "Marlene" - Mathieu = "Mathieu" - Matthew = "Matthew" - Maxim = "Maxim" - Mia = "Mia" - Miguel = "Miguel" - Mizuki = "Mizuki" - Naja = "Naja" - Nicole = "Nicole" - Penelope = "Penelope" - Raveena = "Raveena" - Ricardo = "Ricardo" - Ruben = "Ruben" - Russell = "Russell" - Salli = "Salli" - Seoyeon = "Seoyeon" - Takumi = "Takumi" - Tatyana = "Tatyana" - Vicki = "Vicki" - Vitoria = "Vitoria" - Zeina = "Zeina" - Zhiyu = "Zhiyu" - - PollyVoice = PollyVoices.Justin + PollyVoice = config__definitions.PollyVoices.Justin #Misc Configs slurList = badwords.slurList diff --git a/config_management_module.py b/config_management_module.py index b646906..768cbab 100644 --- a/config_management_module.py +++ b/config_management_module.py @@ -1,30 +1,33 @@ import massedit import credentials -import config - -import config_default +import config__definitions +from config__definitions import * +from config_default import Config_Default import json import inspect import utilities_script as utilities -class Config_Management_Module(): +class Config_Management_Module(Config_Default): def __init__(self): super().__init__() - self.configNames = ['config.py'] - self.config = Config_Wrap() + self.config = Config_Poppet() def mainTest(self): print("[Config Management Module]> test") #print(self.doesConfigExist("twitch_module")) #self.editConfig('twitch_module: bool = False', 'twitch_module: bool = True') #test = config_default.Config_Default() - test = {1:2, 3:4, 5:6, 7:8, 987:{1:2, 3:4, 5:6, 7:8}} - print(self.tempFunc(test)) - testConfig = Config_Wrap() - testConfig.currentConfig.loadConfig_Default() + #test = {1:2, 3:4, 5:6, 7:8, 987:{1:2, 3:4, 5:6, 7:8}} + #print(self.tempFunc(test)) + #testConfig = Config_Wrap() + #testConfig.currentConfig.loadConfig_Default() + #self.autoEnabled_Twitch_rgbLightControl + + #print(config.credentialsNickname) + def tempFunc(self, configtext): #return json.dump(configtext, "") @@ -38,30 +41,39 @@ class Config_Management_Module(): return doesExist -class Config_Wrap(): +class Config_Poppet(Config_Default): def __init__(self): super().__init__() - self.currentConfig = Config() + #self.currentConfig = Config() -class Config(): +class Config(Config_Default): def __init__(self): super().__init__() self.name = "default_config" self.data = {} - def getConfig(self): - pass + def getConfig(self, key): + return self.data[key] - def setConfig(self): - pass + def setConfig(self, key, value): + self.data[key] = value - def loadConfig(self): + def loadConfig(self, filename): pass def loadConfig_Default(self): - tempConfig = config_default.Config_Default() + tempConfig = Config_Default() for obj in inspect.getmembers(tempConfig): - print(obj) + name = obj[0] + #print(name) + self.data[name] = obj[1] + + for var in self.data: + print(var ," = ", self.data[var]) + #self.var = self.data[var] + + #for shit in self.data: + #print("found some", shit) diff --git a/db.py b/db.py index f649999..69690e8 100644 --- a/db.py +++ b/db.py @@ -1,6 +1,6 @@ import credentials -import config as config +import config_management_module as config import pandas as pd from sqlalchemy import create_engine diff --git a/discord_script.py b/discord_script.py index 7ffb524..cd63a96 100644 --- a/discord_script.py +++ b/discord_script.py @@ -6,7 +6,7 @@ from discord import message from discord.client import Client import asyncio -import config as config +import config_management_module as config import db import tts diff --git a/help_module.py b/help_module.py index b67a4bf..59b4e8e 100644 --- a/help_module.py +++ b/help_module.py @@ -1,6 +1,6 @@ from commands.command_base import AbstractCommand from enum import Enum -import config as config +import config_management_module as config import db import commands.loader as command_loader diff --git a/lights_module.py b/lights_module.py index 9e5fa9d..ef7167b 100644 --- a/lights_module.py +++ b/lights_module.py @@ -6,7 +6,7 @@ import random import utilities_script as utilities import credentials -import config +import config_management_module as config class Lights_Module(): def __init__(self): diff --git a/main.py b/main.py index f4018cf..ccb9f54 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ import test_module import user_module import utilities_script as utility -import config as config +import config_management_module as config import credentials diff --git a/tempText_Module.py b/tempText_Module.py index 158e912..9a95fda 100644 --- a/tempText_Module.py +++ b/tempText_Module.py @@ -1,4 +1,4 @@ -import config +import config_management_module as config import utilities_script as utilities import os diff --git a/test_module.py b/test_module.py index 9594d9b..7d2f7d3 100644 --- a/test_module.py +++ b/test_module.py @@ -1,4 +1,4 @@ -import config as config +import config_management_module as config import db import credentials diff --git a/thread_management_module.py b/thread_management_module.py index 9be43a7..e287c35 100644 --- a/thread_management_module.py +++ b/thread_management_module.py @@ -8,7 +8,7 @@ import test_module import user_module import utilities_script as utility -import config as config +import config_management_module as config import credentials diff --git a/tts.py b/tts.py index 6e026aa..04f0c26 100644 --- a/tts.py +++ b/tts.py @@ -7,7 +7,7 @@ from gtts import gTTS from playsound import playsound import utilities_script as utility -import config +import config_management_module as config streamLabsUrl = "https://streamlabs.com/polly/speak" diff --git a/twitch_script.py b/twitch_script.py index 2c886f0..b65f337 100644 --- a/twitch_script.py +++ b/twitch_script.py @@ -6,7 +6,7 @@ import utilities_script as utilities import twitch import twitch.chat -import config as config +import config_management_module as config import db import tts import commands.loader as command_loader diff --git a/user_module.py b/user_module.py index 023c042..afdba8a 100644 --- a/user_module.py +++ b/user_module.py @@ -1,6 +1,6 @@ from enum import Enum import time -import config as config +import config_management_module as config import db import tts diff --git a/utilities_script.py b/utilities_script.py index fdf5a81..d7940cf 100644 --- a/utilities_script.py +++ b/utilities_script.py @@ -6,7 +6,7 @@ import psutil import subprocess import platform import time -import config as config +import config_management_module as config import art clearScreen = lambda: os.system('cls' if os.name == 'nt' else 'clear') diff --git a/webSource_module.py b/webSource_module.py index 54a7dce..ad9ed13 100644 --- a/webSource_module.py +++ b/webSource_module.py @@ -2,7 +2,7 @@ from enum import Enum from os import F_OK import tempText_Module import time -import config as config +import config_management_module as config import db import tts import threading