config Attempt
This commit is contained in:
parent
c80a51d497
commit
d5d27ffc6b
@ -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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import config
|
||||
import config_management_module as config
|
||||
import utilities_script as utilities
|
||||
import os
|
||||
|
||||
|
||||
@ -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(" ")
|
||||
|
||||
158
config.py
158
config.py
@ -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 "
|
||||
77
config__definitions.py
Normal file
77
config__definitions.py
Normal file
@ -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"
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
2
db.py
2
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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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):
|
||||
|
||||
2
main.py
2
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
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import config
|
||||
import config_management_module as config
|
||||
import utilities_script as utilities
|
||||
import os
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import config as config
|
||||
import config_management_module as config
|
||||
import db
|
||||
|
||||
import credentials
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
2
tts.py
2
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"
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
from enum import Enum
|
||||
import time
|
||||
import config as config
|
||||
import config_management_module as config
|
||||
import db
|
||||
import tts
|
||||
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user