Merge pull request 'master updates' (#22) from master into db-module
Reviewed-on: #22
This commit is contained in:
commit
d6765e18b8
@ -1,4 +1,6 @@
|
|||||||
import config
|
import config
|
||||||
|
import utilities_script as utilities
|
||||||
|
import os
|
||||||
|
|
||||||
class Chyron_Module():
|
class Chyron_Module():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -6,6 +8,36 @@ class Chyron_Module():
|
|||||||
self.chyron_computedString = ""
|
self.chyron_computedString = ""
|
||||||
self.chyron_items:list = []
|
self.chyron_items:list = []
|
||||||
|
|
||||||
|
def main(self, rightNow_ = "Chill Stream"):
|
||||||
|
self.addItem(
|
||||||
|
"RightNow",
|
||||||
|
"► Now: ",
|
||||||
|
rightNow_)
|
||||||
|
self.addItem(
|
||||||
|
"WeekDays",
|
||||||
|
"► Weekdays: ",
|
||||||
|
"Daily Stream @ 12pm Noon EST")
|
||||||
|
self.addItem(
|
||||||
|
"FriSat",
|
||||||
|
"► Friday & Saturday: ",
|
||||||
|
"FFxiv (Express Delivery Raid Team) @ 7pm EST")
|
||||||
|
self.addItem(
|
||||||
|
"Commands",
|
||||||
|
"► Commands: ",
|
||||||
|
"!animal, !climateclock, !discord, !lights, !page, !roll")
|
||||||
|
self.addItem(
|
||||||
|
"Website",
|
||||||
|
"► Want to read about my various projects? visit: ",
|
||||||
|
"TheCuriousNerd.com")
|
||||||
|
self.addItem(
|
||||||
|
"Follow",
|
||||||
|
"► ",
|
||||||
|
"If you like what you see, hit that follow button to see more!")
|
||||||
|
self.addItem(
|
||||||
|
"Discord",
|
||||||
|
"► Want to join our discord? type \" !d \" in chat to get the link or visit: ",
|
||||||
|
"discord.io/thecuriousnerd")
|
||||||
|
|
||||||
def chyron_stringUpdater(self):
|
def chyron_stringUpdater(self):
|
||||||
newString = ""
|
newString = ""
|
||||||
for c in self.chyron_items:
|
for c in self.chyron_items:
|
||||||
@ -14,6 +46,7 @@ class Chyron_Module():
|
|||||||
for x in range(config.chyronListSpaceCount):
|
for x in range(config.chyronListSpaceCount):
|
||||||
newString = newString + " "
|
newString = newString + " "
|
||||||
self.chyron_computedString = newString
|
self.chyron_computedString = newString
|
||||||
|
return newString
|
||||||
|
|
||||||
def addItem(self, name, title, content):
|
def addItem(self, name, title, content):
|
||||||
newItem:ChyronItem = ChyronItem()
|
newItem:ChyronItem = ChyronItem()
|
||||||
@ -25,6 +58,17 @@ class Chyron_Module():
|
|||||||
if c.itemName == name:
|
if c.itemName == name:
|
||||||
self.chyron_items.remove(c)
|
self.chyron_items.remove(c)
|
||||||
|
|
||||||
|
def updateChyronFile(self):
|
||||||
|
dir = utilities.get_dir("stream_sources")
|
||||||
|
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
||||||
|
relative_path = "stream_sources/chyron.txt"
|
||||||
|
real_file_path = os.path.join(script_dir, relative_path)
|
||||||
|
|
||||||
|
file = open(real_file_path, "wb")
|
||||||
|
chyron = self.chyron_stringUpdater().encode("utf8")
|
||||||
|
file.write(chyron)
|
||||||
|
file.close
|
||||||
|
|
||||||
|
|
||||||
class ChyronItem():
|
class ChyronItem():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -54,31 +98,10 @@ class ChyronItem():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
testModule = Chyron_Module()
|
testModule = Chyron_Module()
|
||||||
testModule.addItem(
|
testModule.main()
|
||||||
"test",
|
|
||||||
"Now: ",
|
|
||||||
"Coding Stream")
|
|
||||||
testModule.addItem(
|
|
||||||
"FriSat",
|
|
||||||
"► Friday & Saturday: ",
|
|
||||||
"Coding Stream")
|
|
||||||
testModule.addItem(
|
|
||||||
"Commands",
|
|
||||||
"► Commands: ",
|
|
||||||
"!animal, !climateclock, !discord, !page, !roll")
|
|
||||||
testModule.addItem(
|
|
||||||
"Website",
|
|
||||||
"► Want to read about my various projects? visit: ",
|
|
||||||
"TheCuriousNerd.com")
|
|
||||||
testModule.addItem(
|
|
||||||
"Follow",
|
|
||||||
"",
|
|
||||||
"► If you like what you see, hit that follow button to see more!")
|
|
||||||
testModule.addItem(
|
|
||||||
"Discord",
|
|
||||||
"► Want to join our discord? type \" !d \" in chat to get the link or visit: ",
|
|
||||||
"discord.io/thecuriousnerd")
|
|
||||||
testModule.chyron_stringUpdater()
|
testModule.chyron_stringUpdater()
|
||||||
|
|
||||||
test = testModule.chyron_computedString + "<<<|"
|
test = testModule.chyron_computedString + "<<<|"
|
||||||
print(test)
|
print(test)
|
||||||
|
|
||||||
|
testModule.updateChyronFile()
|
||||||
35
commands/implemented/command_chyron.py
Normal file
35
commands/implemented/command_chyron.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
from abc import ABCMeta
|
||||||
|
import chyron_module
|
||||||
|
|
||||||
|
from commands.command_base import AbstractCommand
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
|
import utilities_script as utilities
|
||||||
|
|
||||||
|
class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
||||||
|
"""
|
||||||
|
this is the roll command.
|
||||||
|
"""
|
||||||
|
command = "chyron"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__(CommandRoll.command, n_args=5, command_type=AbstractCommand.CommandType.Praxis)
|
||||||
|
|
||||||
|
def do_command(self, bot, user_message):
|
||||||
|
tempBool = True
|
||||||
|
if tempBool == True:
|
||||||
|
tempParsedMessage = user_message.message.split(" ")
|
||||||
|
i = len(tempParsedMessage)
|
||||||
|
|
||||||
|
if i > 1:
|
||||||
|
if "update" in tempParsedMessage[1]:
|
||||||
|
chyron = chyron_module.Chyron_Module()
|
||||||
|
if i > 2:
|
||||||
|
chyron.main(tempParsedMessage[2])
|
||||||
|
else:
|
||||||
|
chyron.main()
|
||||||
|
chyron.updateChyronFile()
|
||||||
|
|
||||||
|
returnMessage = "@" + user_message.user + " updated the chyron!"
|
||||||
|
bot.return_message(returnMessage)
|
||||||
@ -11,7 +11,7 @@ class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
|||||||
"""
|
"""
|
||||||
this is the roll command.
|
this is the roll command.
|
||||||
"""
|
"""
|
||||||
command = "!lights"
|
command = "lights"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.Praxis)
|
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.Praxis)
|
||||||
@ -21,38 +21,47 @@ class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
|||||||
if tempBool == True:
|
if tempBool == True:
|
||||||
LightModule = lights_module.Lights_Module()
|
LightModule = lights_module.Lights_Module()
|
||||||
LightModule.main()
|
LightModule.main()
|
||||||
print("\nRGB Command Detected!")
|
#print("\nRGB Command Detected!")
|
||||||
|
|
||||||
tempParsedMessage = user_message.message.split(" ")
|
tempParsedMessage = user_message.message.split(" ")
|
||||||
print("\nParsed Command! ", user_message.message)
|
sceneCommand = False
|
||||||
if (len(tempParsedMessage)) > 2:
|
if (len(tempParsedMessage)) > 2:
|
||||||
print("\nRGB Command!")
|
print("RGB Command!")
|
||||||
rgb_r = float(tempParsedMessage[1])
|
rgb_r = float(tempParsedMessage[1])
|
||||||
rgb_g = float(tempParsedMessage[2])
|
rgb_g = float(tempParsedMessage[2])
|
||||||
rgb_b = float(tempParsedMessage[3])
|
rgb_b = float(tempParsedMessage[3])
|
||||||
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
||||||
print("got XY")
|
#print("got XY")
|
||||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||||
print("sent color")
|
print("sent color to [Lights_Module]")
|
||||||
else:
|
else:
|
||||||
if "stream" in tempParsedMessage:
|
if "stream" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "Stream")
|
LightModule.bridge_.run_scene("Downstairs", "Stream")
|
||||||
elif "normal" in tempParsedMessage:
|
elif "normal" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "Bright")
|
LightModule.bridge_.run_scene("Downstairs", "Bright")
|
||||||
elif "haxor" in tempParsedMessage:
|
elif "haxor" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "hacker vibes")
|
LightModule.bridge_.run_scene("Downstairs", "hacker vibes")
|
||||||
elif "off" in tempParsedMessage:
|
elif "off" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.set_group("Downstairs", "on", False)
|
LightModule.bridge_.set_group("Downstairs", "on", False)
|
||||||
elif "on" in tempParsedMessage:
|
elif "on" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.set_group("Downstairs", "on", True)
|
LightModule.bridge_.set_group("Downstairs", "on", True)
|
||||||
elif "ravemode" in tempParsedMessage:
|
elif "ravemode" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.raveMode()
|
LightModule.raveMode()
|
||||||
else:
|
else:
|
||||||
print("\nColor Command!")
|
print("Color Command!")
|
||||||
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
||||||
print("got XY")
|
#print("got XY")
|
||||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||||
print("sent color")
|
print("sent color to [Lights_Module]")
|
||||||
|
|
||||||
|
if sceneCommand == True:
|
||||||
|
print("Scene Command!")
|
||||||
|
|
||||||
returnMessage = "@" + user_message.user + " changed the light's color!"
|
returnMessage = "@" + user_message.user + " changed the light's color!"
|
||||||
bot.return_message(returnMessage)
|
bot.return_message(returnMessage)
|
||||||
@ -17,41 +17,51 @@ class CommandRoll(AbstractCommand, metaclass=ABCMeta):
|
|||||||
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.TWITCH)
|
super().__init__(CommandRoll.command, n_args=3, command_type=AbstractCommand.CommandType.TWITCH)
|
||||||
|
|
||||||
def do_command(self, bot, twitch_message):
|
def do_command(self, bot, twitch_message):
|
||||||
|
|
||||||
if bot.allow_rgbLightControl == True:
|
if bot.allow_rgbLightControl == True:
|
||||||
LightModule = lights_module.Lights_Module()
|
LightModule = lights_module.Lights_Module()
|
||||||
LightModule.main()
|
LightModule.main()
|
||||||
print("\nRGB Command Detected!")
|
#print("\nRGB Command Detected!")
|
||||||
|
|
||||||
tempParsedMessage = twitch_message.text.split(" ")
|
tempParsedMessage = twitch_message.text.split(" ")
|
||||||
print("\nParsed Command! ", twitch_message.text)
|
sceneCommand = False
|
||||||
if (len(tempParsedMessage)) > 2:
|
if (len(tempParsedMessage)) > 2:
|
||||||
print("\nRGB Command!")
|
print("RGB Command!")
|
||||||
rgb_r = float(tempParsedMessage[1])
|
rgb_r = float(tempParsedMessage[1])
|
||||||
rgb_g = float(tempParsedMessage[2])
|
rgb_g = float(tempParsedMessage[2])
|
||||||
rgb_b = float(tempParsedMessage[3])
|
rgb_b = float(tempParsedMessage[3])
|
||||||
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
xy_result = LightModule.rgb_to_xy(rgb_r, rgb_g, rgb_b)
|
||||||
print("got XY")
|
#print("got XY")
|
||||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||||
print("sent color")
|
print("sent color to [Lights_Module]")
|
||||||
else:
|
else:
|
||||||
if "stream" in tempParsedMessage:
|
if "stream" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "Stream")
|
LightModule.bridge_.run_scene("Downstairs", "Stream")
|
||||||
elif "normal" in tempParsedMessage:
|
elif "normal" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "Bright")
|
LightModule.bridge_.run_scene("Downstairs", "Bright")
|
||||||
elif "haxor" in tempParsedMessage:
|
elif "haxor" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.run_scene("Downstairs", "hacker vibes")
|
LightModule.bridge_.run_scene("Downstairs", "hacker vibes")
|
||||||
elif "off" in tempParsedMessage:
|
elif "off" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.set_group("Downstairs", "on", False)
|
LightModule.bridge_.set_group("Downstairs", "on", False)
|
||||||
elif "on" in tempParsedMessage:
|
elif "on" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.bridge_.set_group("Downstairs", "on", True)
|
LightModule.bridge_.set_group("Downstairs", "on", True)
|
||||||
elif "ravemode" in tempParsedMessage:
|
elif "ravemode" in tempParsedMessage:
|
||||||
|
sceneCommand = True
|
||||||
LightModule.raveMode()
|
LightModule.raveMode()
|
||||||
else:
|
else:
|
||||||
print("\nColor Command!")
|
print("Color Command!")
|
||||||
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
xy_result = LightModule.color_string_parser(tempParsedMessage)
|
||||||
print("got XY")
|
#print("got XY")
|
||||||
LightModule.bridge_.set_group(16, "xy", xy_result)
|
LightModule.bridge_.set_group(16, "xy", xy_result)
|
||||||
print("sent color")
|
print("sent color to [Lights_Module]")
|
||||||
|
|
||||||
|
if sceneCommand == True:
|
||||||
|
print("Scene Command!")
|
||||||
|
|
||||||
returnMessage = "@" + twitch_message.sender + " changed the light's color!"
|
returnMessage = "@" + twitch_message.sender + " changed the light's color!"
|
||||||
bot.send_message(returnMessage)
|
bot.send_message(returnMessage)
|
||||||
@ -44,6 +44,11 @@ autoEnabled_Discord_rgbLightControl = False
|
|||||||
#Chyron Module Configs
|
#Chyron Module Configs
|
||||||
chyronListSpaceCount = 25
|
chyronListSpaceCount = 25
|
||||||
|
|
||||||
|
|
||||||
|
#Lights Module Configs
|
||||||
|
colorParse_maxDigits = 4
|
||||||
|
|
||||||
|
|
||||||
#General Configs
|
#General Configs
|
||||||
skip_splashScreen = False
|
skip_splashScreen = False
|
||||||
skip_splashScreenClear = False
|
skip_splashScreenClear = False
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class Lights_Module():
|
|||||||
self.bridge_:Bridge = Bridge('192.168.191.146')
|
self.bridge_:Bridge = Bridge('192.168.191.146')
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
print("Starting up Lights_Modules....")
|
print("Starting up [Lights_Module]...")
|
||||||
self.bridge_.connect()
|
self.bridge_.connect()
|
||||||
|
|
||||||
self.bridge_.get_api()
|
self.bridge_.get_api()
|
||||||
@ -24,11 +24,11 @@ class Lights_Module():
|
|||||||
groups = self.bridge_.get_group()
|
groups = self.bridge_.get_group()
|
||||||
groupCount = 0
|
groupCount = 0
|
||||||
|
|
||||||
print("\n -Listing Lights...")
|
#print("\n -Listing Lights...")
|
||||||
for l in light_list:
|
for l in light_list:
|
||||||
pass
|
pass
|
||||||
#print(l.name)
|
#print(l.name)
|
||||||
print("\n -Counting Groups...")
|
#print("\n -Counting Groups...")
|
||||||
for g in groups:
|
for g in groups:
|
||||||
#print(g)
|
#print(g)
|
||||||
groupCount = int(g)
|
groupCount = int(g)
|
||||||
@ -65,7 +65,7 @@ class Lights_Module():
|
|||||||
# This will set the group Downstairs to the Stream scene
|
# This will set the group Downstairs to the Stream scene
|
||||||
#self.bridge_.run_scene("Downstairs", "Stream")
|
#self.bridge_.run_scene("Downstairs", "Stream")
|
||||||
|
|
||||||
print("\n Setup Complete")
|
print("-[Lights_Module] Setup Complete")
|
||||||
|
|
||||||
def setLight():
|
def setLight():
|
||||||
pass
|
pass
|
||||||
@ -117,23 +117,23 @@ class Lights_Module():
|
|||||||
return [x, y]
|
return [x, y]
|
||||||
|
|
||||||
def color_string_parser(self, message):
|
def color_string_parser(self, message):
|
||||||
maxDigits = 4
|
maxDigits = config.colorParse_maxDigits
|
||||||
print("trying to find color")
|
print("Searching for color...")
|
||||||
xy_color = [0, 0]
|
xy_color = [0, 0]
|
||||||
for text in message:
|
for text in message:
|
||||||
#print("testing word")
|
#print("testing word")
|
||||||
if "red" in text.lower():
|
if "red" in text.lower():
|
||||||
xy_color = self.rgb_to_xy(1,0,0)
|
xy_color = self.rgb_to_xy(1,0,0)
|
||||||
print("found: red")
|
print("-found: red")
|
||||||
if "blue" in text.lower():
|
if "blue" in text.lower():
|
||||||
print("found: blue")
|
print("-found: blue")
|
||||||
xy_color = self.rgb_to_xy(0,0,1)
|
xy_color = self.rgb_to_xy(0,0,1)
|
||||||
if "green" in text.lower():
|
if "green" in text.lower():
|
||||||
print("found: green")
|
print("-found: green")
|
||||||
xy_color = self.rgb_to_xy(0,1,0)
|
xy_color = self.rgb_to_xy(0,1,0)
|
||||||
|
|
||||||
if "yellow" in text.lower():
|
if "yellow" in text.lower():
|
||||||
print("found: yellow")
|
print("-found: yellow")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
0.7,
|
0.7,
|
||||||
0.64,
|
0.64,
|
||||||
@ -141,23 +141,23 @@ class Lights_Module():
|
|||||||
|
|
||||||
|
|
||||||
if "cyan" in text.lower():
|
if "cyan" in text.lower():
|
||||||
print("found: cyan")
|
print("-found: cyan")
|
||||||
xy_color = self.rgb_to_xy(0,1,1)
|
xy_color = self.rgb_to_xy(0,1,1)
|
||||||
if "aquamarine" in text.lower():
|
if "aquamarine" in text.lower():
|
||||||
print("found: aquamarine")
|
print("-found: aquamarine")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
round(utilities.rescale_value(111,0,254),maxDigits),
|
round(utilities.rescale_value(111,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(218,0,254),maxDigits),
|
round(utilities.rescale_value(218,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(146,0,254),maxDigits))
|
round(utilities.rescale_value(146,0,254),maxDigits))
|
||||||
if "turquoise" in text.lower():
|
if "turquoise" in text.lower():
|
||||||
print("found: turquoise")
|
print("-found: turquoise")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
round(utilities.rescale_value(172,0,254),maxDigits),
|
round(utilities.rescale_value(172,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(233,0,254),maxDigits),
|
round(utilities.rescale_value(233,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(232,0,254),maxDigits))
|
round(utilities.rescale_value(232,0,254),maxDigits))
|
||||||
|
|
||||||
if "orange" in text.lower():
|
if "orange" in text.lower():
|
||||||
print("found: orange")
|
print("-found: orange")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
1,
|
1,
|
||||||
round(utilities.rescale_value(126,0,254),maxDigits),
|
round(utilities.rescale_value(126,0,254),maxDigits),
|
||||||
@ -165,21 +165,21 @@ class Lights_Module():
|
|||||||
|
|
||||||
|
|
||||||
if "magenta" in text.lower():
|
if "magenta" in text.lower():
|
||||||
print("found: magenta")
|
print("-found: magenta")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
1)
|
1)
|
||||||
|
|
||||||
if "purple" in text.lower():
|
if "purple" in text.lower():
|
||||||
print("found: purple")
|
print("-found: purple")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
round(utilities.rescale_value(159,0,254),maxDigits),
|
round(utilities.rescale_value(159,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(32,0,254),maxDigits),
|
round(utilities.rescale_value(32,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(239,0,254),maxDigits))
|
round(utilities.rescale_value(239,0,254),maxDigits))
|
||||||
|
|
||||||
if "violet" in text.lower():
|
if "violet" in text.lower():
|
||||||
print("found: violet")
|
print("-found: violet")
|
||||||
xy_color = self.rgb_to_xy(
|
xy_color = self.rgb_to_xy(
|
||||||
round(utilities.rescale_value(237,0,254),maxDigits),
|
round(utilities.rescale_value(237,0,254),maxDigits),
|
||||||
round(utilities.rescale_value(129,0,254),maxDigits),
|
round(utilities.rescale_value(129,0,254),maxDigits),
|
||||||
|
|||||||
@ -40,6 +40,16 @@ def rescale_value(value, min, max):
|
|||||||
print("got ", returnValue)
|
print("got ", returnValue)
|
||||||
return returnValue
|
return returnValue
|
||||||
|
|
||||||
|
def get_dir(selected_dir):
|
||||||
|
"""
|
||||||
|
Checks for the tts directory, and will create it if it does not exist
|
||||||
|
:return: the relative file path of the tts dir
|
||||||
|
"""
|
||||||
|
dir = os.path.join(os.getcwd(), selected_dir) # this is platform-agnostic
|
||||||
|
if not os.path.exists(dir):
|
||||||
|
os.mkdir(dir)
|
||||||
|
return dir
|
||||||
|
|
||||||
def contains_slur(input: str):
|
def contains_slur(input: str):
|
||||||
containsSlur: bool = False
|
containsSlur: bool = False
|
||||||
parsedMessage = input.split(" ")
|
parsedMessage = input.split(" ")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user