Compare commits
5 Commits
fae2cacb73
...
e424c7ecb6
| Author | SHA1 | Date | |
|---|---|---|---|
| e424c7ecb6 | |||
|
|
c30decd0ef | ||
|
|
8c7bc3e56b | ||
|
|
988f791a42 | ||
|
|
7365c2e3ee |
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ credentials/
|
|||||||
stream_sources/chyron.txt
|
stream_sources/chyron.txt
|
||||||
stream_sources/brb.txt
|
stream_sources/brb.txt
|
||||||
*.log
|
*.log
|
||||||
|
timers/
|
||||||
|
|||||||
@ -26,17 +26,27 @@ class ChannelReward_Hydration(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
|
|
||||||
#print("sending:",user, 16, "!lights hydration")
|
#print("sending:",user, 16, "!lights hydration")
|
||||||
try:
|
try:
|
||||||
if self.is_ChannelReward_enabled:
|
try:
|
||||||
thread_ = threading.Thread(target=self.send_Lights_Command, args=(user, 16, "!lights hydration", ""))
|
if self.is_ChannelReward_enabled:
|
||||||
thread_.daemon = True
|
thread_ = threading.Thread(target=self.send_Lights_Command, args=(user, 16, "!lights hydration", ""))
|
||||||
self.threads.append(thread_)
|
thread_.daemon = True
|
||||||
thread_.start()
|
self.threads.append(thread_)
|
||||||
if self.is_ChannelReward_enabled:
|
thread_.start()
|
||||||
prompt_ = self.get_Phrase(rewardPrompt)
|
except:
|
||||||
thread_ = threading.Thread(target=self.send_TTS, args=(user, prompt_))
|
if self.is_ChannelReward_enabled:
|
||||||
thread_.daemon = True
|
thread_ = threading.Thread(target=self.send_TTS, args=("", "Silly Nerd Fix The Lights Module"))
|
||||||
self.threads.append(thread_)
|
thread_.daemon = True
|
||||||
thread_.start()
|
self.threads.append(thread_)
|
||||||
|
thread_.start()
|
||||||
|
try:
|
||||||
|
if self.is_ChannelReward_enabled:
|
||||||
|
prompt_ = self.get_Phrase(rewardPrompt)
|
||||||
|
thread_ = threading.Thread(target=self.send_TTS, args=(user, prompt_))
|
||||||
|
thread_.daemon = True
|
||||||
|
self.threads.append(thread_)
|
||||||
|
thread_.start()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -46,7 +56,7 @@ class ChannelReward_Hydration(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +72,7 @@ class ChannelReward_Hydration(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class ChannelReward_RubiksCube(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -63,7 +63,7 @@ class ChannelReward_RubiksCube(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_Suggest_Poll(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_Suggest_Poll(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_TTS_Message(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_TTS_Message(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_Workout_Pushups(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_Workout_Pushups(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_Workout_Situps(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_Workout_Situps(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_Workout_Squats(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_Workout_Squats(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class ChannelReward_TwitchBits(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -61,7 +61,7 @@ class ChannelReward_TwitchBits(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ChannelReward_TwitchSubs(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -62,7 +62,7 @@ class ChannelReward_TwitchSubs(AbstractChannelRewards, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class Command_chyron_v2(AbstractCommand, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class Command_lights_v2(AbstractCommand, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class Command_Text_v2(AbstractCommand, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class Command_tts_v2(AbstractCommand, metaclass=ABCMeta):
|
|||||||
# todo need to url-escape command and rest
|
# todo need to url-escape command and rest
|
||||||
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
params = urlencode({'user_name': username, 'light_group': light_group, 'command': command, 'rest':rest})
|
||||||
#standalone_lights
|
#standalone_lights
|
||||||
url = "http://standalone_lights:42069/api/v1/exec_lights?%s" % params
|
url = "http://standalone_lights:42042/api/v1/exec_lights?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -83,7 +83,7 @@ class Command_tts_v2(AbstractCommand, metaclass=ABCMeta):
|
|||||||
def send_TTS(self, username, message):
|
def send_TTS(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -5,7 +5,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "./:/Praxis/"
|
- "./:/Praxis/"
|
||||||
ports:
|
ports:
|
||||||
- 6009:6009
|
- 42010:42010
|
||||||
environment:
|
environment:
|
||||||
- ISDOCKER=cat
|
- ISDOCKER=cat
|
||||||
standalone_channelrewards:
|
standalone_channelrewards:
|
||||||
@ -13,7 +13,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "./:/Praxis/"
|
- "./:/Praxis/"
|
||||||
ports:
|
ports:
|
||||||
- 6969:6969
|
- 42069:42069
|
||||||
environment:
|
environment:
|
||||||
- ISDOCKER=cat
|
- ISDOCKER=cat
|
||||||
standalone_lights:
|
standalone_lights:
|
||||||
@ -21,7 +21,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "./:/Praxis/"
|
- "./:/Praxis/"
|
||||||
ports:
|
ports:
|
||||||
- 42069:42069
|
- 42042:42042
|
||||||
environment:
|
environment:
|
||||||
- ISDOCKER=cat
|
- ISDOCKER=cat
|
||||||
standalone_tts_core:
|
standalone_tts_core:
|
||||||
@ -29,7 +29,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "./:/Praxis/"
|
- "./:/Praxis/"
|
||||||
ports:
|
ports:
|
||||||
- 60809:60809
|
- 42064:42064
|
||||||
environment:
|
environment:
|
||||||
- ISDOCKER=cat
|
- ISDOCKER=cat
|
||||||
standalone_websource:
|
standalone_websource:
|
||||||
@ -37,7 +37,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "./:/Praxis/"
|
- "./:/Praxis/"
|
||||||
ports:
|
ports:
|
||||||
- 5500:5500
|
- 42088:42088
|
||||||
environment:
|
environment:
|
||||||
- ISDOCKER=cat
|
- ISDOCKER=cat
|
||||||
standalone_twitchscript:
|
standalone_twitchscript:
|
||||||
|
|||||||
@ -110,4 +110,4 @@ def exec_reward():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init()
|
init()
|
||||||
api.run(host='0.0.0.0', port=6969)
|
api.run(host='0.0.0.0', port=42069)
|
||||||
|
|||||||
@ -83,4 +83,4 @@ def exec_command():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init()
|
init()
|
||||||
api.run(host='0.0.0.0', port=6009)
|
api.run(host='0.0.0.0', port=42010)
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class Discord_Module(discord.Client):
|
|||||||
async def is_command(self, word: str) -> bool:
|
async def is_command(self, word: str) -> bool:
|
||||||
# todo need to url-escape word
|
# todo need to url-escape word
|
||||||
clean_param = urlencode({'name': word})
|
clean_param = urlencode({'name': word})
|
||||||
url = "http://standalone_command:6009/api/v1/command?%s" % clean_param
|
url = "http://standalone_command:42010/api/v1/command?%s" % clean_param
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
return resp.status_code == 200
|
return resp.status_code == 200
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ class Discord_Module(discord.Client):
|
|||||||
'rest': rest,
|
'rest': rest,
|
||||||
'bonus_data': realMessage})
|
'bonus_data': realMessage})
|
||||||
|
|
||||||
url = "http://standalone_command:6009/api/v1/exec_command?%s" % params
|
url = "http://standalone_command:42010/api/v1/exec_command?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -180,7 +180,7 @@ class Discord_Module(discord.Client):
|
|||||||
async def exec_tts_sender(self, username, message):
|
async def exec_tts_sender(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -302,5 +302,5 @@ def exec_lights():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
init()
|
init()
|
||||||
api.run(host='0.0.0.0', port=42069)
|
api.run(host='0.0.0.0', port=42042)
|
||||||
#testModule.raveMode()
|
#testModule.raveMode()
|
||||||
@ -42,4 +42,4 @@ def makeRequest():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
init()
|
init()
|
||||||
api.run(host='0.0.0.0', port=6009)
|
api.run(host='0.0.0.0', port=42010)
|
||||||
@ -51,4 +51,4 @@ def tts_send_text():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#send_text("","Blah Blah Blah")
|
#send_text("","Blah Blah Blah")
|
||||||
#init()
|
#init()
|
||||||
api.run(host='0.0.0.0', port=60809)
|
api.run(host='0.0.0.0', port=42064)
|
||||||
@ -171,7 +171,7 @@ class Twitch_Pubsub():
|
|||||||
clean_param = urlencode({'reward_name': rewardName, 'reward_type':rewardType})
|
clean_param = urlencode({'reward_name': rewardName, 'reward_type':rewardType})
|
||||||
print(rewardName, rewardType)
|
print(rewardName, rewardType)
|
||||||
#standalone_channelrewards
|
#standalone_channelrewards
|
||||||
url = "http://standalone_channelrewards:6969/api/v1/reward?%s" % clean_param
|
url = "http://standalone_channelrewards:42069/api/v1/reward?%s" % clean_param
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
return resp.status_code == 200
|
return resp.status_code == 200
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ class Twitch_Pubsub():
|
|||||||
'bonus_data': realMessage})
|
'bonus_data': realMessage})
|
||||||
|
|
||||||
#standalone_channelrewards
|
#standalone_channelrewards
|
||||||
url = "http://standalone_channelrewards:6969/api/v1/exec_reward?%s" % params
|
url = "http://standalone_channelrewards:42069/api/v1/exec_reward?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class Twitch_Module():
|
|||||||
def is_command(self, word: str) -> bool:
|
def is_command(self, word: str) -> bool:
|
||||||
# todo need to url-escape word
|
# todo need to url-escape word
|
||||||
clean_param = urlencode({'name': word})
|
clean_param = urlencode({'name': word})
|
||||||
url = "http://standalone_command:6009/api/v1/command?%s" % clean_param
|
url = "http://standalone_command:42010/api/v1/command?%s" % clean_param
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
return resp.status_code == 200
|
return resp.status_code == 200
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class Twitch_Module():
|
|||||||
'rest': rest,
|
'rest': rest,
|
||||||
'bonus_data': realMessage})
|
'bonus_data': realMessage})
|
||||||
|
|
||||||
url = "http://standalone_command:6009/api/v1/exec_command?%s" % params
|
url = "http://standalone_command:42010/api/v1/exec_command?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
@ -134,7 +134,7 @@ class Twitch_Module():
|
|||||||
def exec_tts_sender(self, username, message):
|
def exec_tts_sender(self, username, message):
|
||||||
params = urlencode({'tts_sender': username, 'tts_text': message})
|
params = urlencode({'tts_sender': username, 'tts_text': message})
|
||||||
#standalone_tts_core
|
#standalone_tts_core
|
||||||
url = "http://standalone_tts_core:60809/api/v1/tts/send_text?%s" % params
|
url = "http://standalone_tts_core:42064/api/v1/tts/send_text?%s" % params
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
@ -16,7 +16,13 @@ from cooldowns import Cooldown_Module
|
|||||||
import utilities_script as utility
|
import utilities_script as utility
|
||||||
|
|
||||||
import chyron_module
|
import chyron_module
|
||||||
|
import timers_module
|
||||||
|
|
||||||
|
import os
|
||||||
|
import praxis_logging
|
||||||
|
praxis_logger_obj = praxis_logging.praxis_logger()
|
||||||
|
praxis_logger_obj.init(os.path.basename(__file__))
|
||||||
|
praxis_logger_obj.log("\n -Starting Logs: " + os.path.basename(__file__))
|
||||||
|
|
||||||
api:Flask = Flask(__name__)
|
api:Flask = Flask(__name__)
|
||||||
api.config["DEBUG"] = True
|
api.config["DEBUG"] = True
|
||||||
@ -40,13 +46,21 @@ def textSource_tempText(file_name):
|
|||||||
tempModule = tempText_Module.tempText_Module()
|
tempModule = tempText_Module.tempText_Module()
|
||||||
return tempModule.getTempTextFile(file_name)
|
return tempModule.getTempTextFile(file_name)
|
||||||
|
|
||||||
@api.route('/timer/<timer_name>/')
|
@api.route('/timer/status/<timer_name>/')
|
||||||
def textSource_timers(timer_name):
|
def textSource_timerStatus(timer_name):
|
||||||
#print("trying file: ", filename)
|
tempModule = timers_module.Timers_Module()
|
||||||
#tempModule = tempText_Module.tempText_Module()
|
result = tempModule.checkTimerStatus_fromFiles(timer_name)
|
||||||
#tempModule.getTempTextFile(filename)
|
returnString = "Timer %s is %s" % (timer_name, result)
|
||||||
return "Coming Soon"
|
return returnString
|
||||||
|
|
||||||
|
@api.route('/timer/time/<timer_name>/')
|
||||||
|
def textSource_timerTime(timer_name):
|
||||||
|
tempModule = timers_module.Timers_Module()
|
||||||
|
result = tempModule.checkTime_fromFiles(timer_name)
|
||||||
|
if result is None: result = ""
|
||||||
|
returnString = result
|
||||||
|
return returnString
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
init()
|
init()
|
||||||
api.run(host="0.0.0.0", port = 5500)
|
api.run(host="0.0.0.0", port = 42088)
|
||||||
183
timers_module.py
183
timers_module.py
@ -1,52 +1,151 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
from praxis_logging import praxis_logger
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
import utilities_script as utility
|
import utilities_script as utility
|
||||||
|
import importlib
|
||||||
|
import importlib.util
|
||||||
|
import sys
|
||||||
|
import inspect
|
||||||
|
|
||||||
class timer():
|
class timer():
|
||||||
def __init__(self, name, startTime, endTime, trigger, trigger_exec, tempTimer = True):
|
def __init__(self,
|
||||||
|
name,
|
||||||
|
startTime = datetime.datetime.now,
|
||||||
|
endTime = datetime.datetime.now,
|
||||||
|
trigger = "",
|
||||||
|
trigger_exec = "",
|
||||||
|
timerFormat = "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
tempTimer = True):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.startTime = startTime
|
self.startTime = startTime
|
||||||
self.endTime = endTime
|
self.endTime = endTime
|
||||||
self.trigger = trigger
|
self.trigger = trigger
|
||||||
self.trigger_exec = trigger_exec
|
self.trigger_exec = trigger_exec
|
||||||
|
self.timerFormat = timerFormat
|
||||||
self.tempTimer = tempTimer # If enabled this will cause the Timer to be deleted upon shutdown or startup
|
self.tempTimer = tempTimer # If enabled this will cause the Timer to be deleted upon shutdown or startup
|
||||||
|
|
||||||
class Timers_Module():
|
class Timers_Module():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.timersList = []
|
self.timersList = {}
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
self.createTimer()
|
self.createTimer("test_timer", seconds=15)
|
||||||
|
#self.createTimer("mega_test_timer", hours=20, seconds=10)
|
||||||
|
#self.updateTimersList()
|
||||||
|
#for t in self.timersList:
|
||||||
|
#print(t)
|
||||||
|
|
||||||
|
#while True:
|
||||||
|
#for t in self.timersList:
|
||||||
|
#print(t)
|
||||||
|
#print(self.checkTimerStatus_fromFiles("test_timer"))
|
||||||
|
#print(self.checkTimerStatus_fromFiles("test_timer_2"))
|
||||||
|
#time.sleep(0.5)
|
||||||
|
|
||||||
|
|
||||||
def updateTimersList(self):
|
def updateTimersList(self):
|
||||||
pass
|
dic = {}
|
||||||
|
implementations = self.get_implementations_dir()
|
||||||
|
for dirName, subdirList, fileList in os.walk(implementations):
|
||||||
|
for file in fileList:
|
||||||
|
print(file)
|
||||||
|
name, startTime, endTime, trigger, trigger_exec, timerFormat, tempTimer = self.readFile(file)
|
||||||
|
newTimer = timer(
|
||||||
|
name,
|
||||||
|
datetime.datetime.strptime(startTime, timerFormat),
|
||||||
|
datetime.datetime.strptime(endTime, timerFormat),
|
||||||
|
trigger,
|
||||||
|
trigger_exec,
|
||||||
|
utility.strToBool(tempTimer))
|
||||||
|
|
||||||
def createTimer(self, days=0, hours=0, minutes=0, seconds=0, microseconds=0, trigger="", trigger_exec="", tempTimer=True):
|
self.timersList[newTimer.name] = newTimer
|
||||||
temp = datetime.datetime.now()
|
return dic
|
||||||
targetTime = temp + datetime.timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds, microseconds=microseconds)
|
|
||||||
|
|
||||||
newTimer= timer()
|
|
||||||
newTimer.startTime = temp
|
|
||||||
newTimer.endTime = targetTime
|
|
||||||
newTimer.trigger = trigger
|
|
||||||
newTimer.trigger_exec = trigger_exec
|
|
||||||
newTimer.tempTimer = tempTimer
|
|
||||||
|
|
||||||
self.timersList.append(newTimer)
|
def get_base_dir(self) -> str:
|
||||||
|
cwd = os.getcwd()
|
||||||
|
split = os.path.split(cwd)
|
||||||
|
current = split[len(split) - 1]
|
||||||
|
if current == 'timers':
|
||||||
|
return self.check_dir(cwd)
|
||||||
|
elif current == 'Praxis_Bot' or current == 'Praxis':
|
||||||
|
return self.check_dir(os.path.join(cwd, "timers"))
|
||||||
|
else:
|
||||||
|
print("could not find working directory for Praxis_Bot/timers")
|
||||||
|
raise Exception
|
||||||
|
|
||||||
def checkTimer(self, name):
|
def get_implementations_dir(self) -> str:
|
||||||
|
return self.check_dir(os.path.join(self.get_base_dir()))
|
||||||
|
|
||||||
name, startTime, endTime, trigger, trigger_exec, tempTimer = self.readFile(name)
|
def check_dir(self, path: str) -> str:
|
||||||
if endTime < datetime.datetime.now():
|
if not os.path.exists(path):
|
||||||
print("do timer thing")
|
os.mkdir(path, 0x777)
|
||||||
self.TIMER_EXEC(name, startTime, endTime, trigger, trigger_exec, tempTimer)
|
return path
|
||||||
|
|
||||||
|
def createTimer(self, name, days=0, hours=0, minutes=0, seconds=0, microseconds=0, trigger="", trigger_exec="", timerFormat='%Y-%m-%d %H:%M:%S.%f', tempTimer=True):
|
||||||
|
startTime = datetime.datetime.now()
|
||||||
|
targetTime = startTime + datetime.timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds, microseconds=microseconds)
|
||||||
|
|
||||||
|
newTimer= timer(name, startTime, targetTime, trigger, trigger_exec, timerFormat, tempTimer)
|
||||||
|
|
||||||
|
self.timersList[newTimer.name] = newTimer
|
||||||
|
self.makeFile(newTimer)
|
||||||
|
|
||||||
|
def checkTimerStatus_fromFiles(self, name):
|
||||||
|
try:
|
||||||
|
if name is not None:
|
||||||
|
name, startTime, endTime, trigger, trigger_exec, timerFormat, tempTimer = self.readFile(name+".json")
|
||||||
|
if datetime.datetime.strptime(endTime, timerFormat) < datetime.datetime.now():
|
||||||
|
#print("do timer thing")
|
||||||
|
#self.TIMER_EXEC(name, datetime.datetime.strptime(startTime, '%Y-%m-%d %H:%M:%S.%f'), datetime.datetime.strptime(endTime, '%Y-%m-%d %H:%M:%S.%f'), trigger, trigger_exec, utility.strToBool(tempTimer))
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
|
def checkTime_fromFiles(self, name):
|
||||||
|
try:
|
||||||
|
name, startTime, endTime, trigger, trigger_exec, timerFormat, tempTimer = self.readFile(name+".json")
|
||||||
|
if name is not None:
|
||||||
|
endT = datetime.datetime.strptime(endTime, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
if endT.timestamp() < datetime.datetime.now().timestamp():
|
||||||
|
print("do timer thing")
|
||||||
|
endT = datetime.datetime.strptime(endTime, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
curTime = datetime.datetime.now()
|
||||||
|
#curTime = datetime.datetime.strptime(curTime, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
result = endT - datetime.timedelta(days=curTime.day, hours=curTime.hour, minutes=curTime.minute, seconds=curTime.second, microseconds=curTime.microsecond)
|
||||||
|
print(type(result))
|
||||||
|
|
||||||
|
#self.TIMER_EXEC(name, datetime.datetime.strptime(startTime, '%Y-%m-%d %H:%M:%S.%f'), datetime.datetime.strptime(endTime, '%Y-%m-%d %H:%M:%S.%f'), trigger, trigger_exec, utility.strToBool(tempTimer))
|
||||||
|
fixedEndTime = datetime.datetime.strftime(result, '%M:%S')
|
||||||
|
return str("Timer Done")
|
||||||
|
else:
|
||||||
|
endT = datetime.datetime.strptime(endTime, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
curTime = str(datetime.datetime.now())
|
||||||
|
curTime = datetime.datetime.strptime(curTime, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
result = endT - datetime.timedelta(days=curTime.day, hours=curTime.hour, minutes=curTime.minute, seconds=curTime.second, microseconds=curTime.microsecond)
|
||||||
|
|
||||||
|
fixedEndTime = datetime.datetime.strftime(result, '%M:%S')
|
||||||
|
#fixedTimeDelta = fixedEndTime - fixedCurTime
|
||||||
|
#praxis_logger.log(str(timeDelta))
|
||||||
|
return str(fixedEndTime)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def deleteTimer(self, name):
|
def deleteTimer(self, name):
|
||||||
self.deleteFile(name)
|
try:
|
||||||
|
self.deleteFile(name+".json")
|
||||||
|
except:
|
||||||
|
print("Deletion Error")
|
||||||
|
self.timersList.pop(name)
|
||||||
|
|
||||||
|
|
||||||
def TIMER_EXEC(self, name, startTime, endTime, trigger, trigger_exec, tempTimer):
|
def TIMER_EXEC(self, name, startTime, endTime, trigger, trigger_exec, tempTimer):
|
||||||
@ -57,30 +156,31 @@ class Timers_Module():
|
|||||||
self.deleteTimer(name)
|
self.deleteTimer(name)
|
||||||
|
|
||||||
|
|
||||||
def makeFile(self, name, startTime, endTime, trigger, trigger_exec, tempTimer = True):
|
def makeFile(self, timer_obj:timer):
|
||||||
dir = utility.get_dir("stream_sources/timers")
|
dir = utility.get_dir("timers")
|
||||||
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
||||||
relative_path = name + ".json"
|
relative_path = timer_obj.name + ".json"
|
||||||
real_file_path = os.path.join(script_dir, relative_path)
|
real_file_path = os.path.join(script_dir, dir, relative_path)
|
||||||
with open(real_file_path, 'rw') as cred_r:
|
|
||||||
data = json.load(cred_r)
|
|
||||||
data['name'] = name
|
|
||||||
data['startTime'] = startTime
|
|
||||||
data['endTime'] = endTime
|
|
||||||
data['trigger'] = trigger
|
|
||||||
data['trigger_exec'] = trigger_exec
|
|
||||||
data['tempTimer'] = tempTimer
|
|
||||||
|
|
||||||
with open(real_file_path, 'w') as cred_w:
|
with open(real_file_path, 'w') as cred_w:
|
||||||
json.dump(data, cred_w, indent=2)
|
#data = json.load(timer_obj)
|
||||||
|
dic = {}
|
||||||
|
dic['name'] = timer_obj.name
|
||||||
|
dic['startTime'] = str(timer_obj.startTime)
|
||||||
|
dic['endTime'] = str(timer_obj.endTime)
|
||||||
|
dic['trigger'] = timer_obj.trigger
|
||||||
|
dic['trigger_exec'] = timer_obj.trigger_exec
|
||||||
|
dic['timerFormat'] = timer_obj.timerFormat
|
||||||
|
dic['tempTimer'] = str(timer_obj.tempTimer)
|
||||||
|
json.dump(dic, cred_w, indent=2)
|
||||||
|
|
||||||
|
|
||||||
def readFile(self, name):
|
def readFile(self, name):
|
||||||
dir = utility.get_dir("stream_sources/timers")
|
dir = utility.get_dir("timers")
|
||||||
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
||||||
relative_path = name + ".json"
|
relative_path = name #+ ".json"
|
||||||
real_file_path = os.path.join(script_dir, relative_path)
|
real_file_path = os.path.join(script_dir, dir, relative_path)
|
||||||
|
|
||||||
startTime, endTime, trigger, tempTimer = None
|
|
||||||
with open(real_file_path, 'r') as cred_r:
|
with open(real_file_path, 'r') as cred_r:
|
||||||
data = json.load(cred_r)
|
data = json.load(cred_r)
|
||||||
name = data['name']
|
name = data['name']
|
||||||
@ -88,14 +188,15 @@ class Timers_Module():
|
|||||||
endTime = data['endTime']
|
endTime = data['endTime']
|
||||||
trigger = data['trigger']
|
trigger = data['trigger']
|
||||||
trigger_exec = data['trigger_exec']
|
trigger_exec = data['trigger_exec']
|
||||||
|
timerFormat = data['timerFormat']
|
||||||
tempTimer = data['tempTimer']
|
tempTimer = data['tempTimer']
|
||||||
return name, startTime, endTime, trigger, trigger_exec, tempTimer
|
return name, startTime, endTime, trigger, trigger_exec, timerFormat, tempTimer
|
||||||
|
|
||||||
def deleteFile(self, name):
|
def deleteFile(self, name):
|
||||||
dir = utility.get_dir("stream_sources/timers")
|
dir = utility.get_dir("timers")
|
||||||
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
script_dir = os.path.dirname(__file__) #<-- absolute dir the script is in
|
||||||
relative_path = name + ".json"
|
relative_path = name #+ ".json"
|
||||||
real_file_path = os.path.join(script_dir, relative_path)
|
real_file_path = os.path.join(script_dir, dir, relative_path)
|
||||||
os.remove(real_file_path)
|
os.remove(real_file_path)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,12 @@ def rescale_value(value, min, max):
|
|||||||
#print("got ", returnValue)
|
#print("got ", returnValue)
|
||||||
return returnValue
|
return returnValue
|
||||||
|
|
||||||
|
def strToBool(stringToTest):
|
||||||
|
if stringToTest == "True":
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def get_dir(selected_dir):
|
def get_dir(selected_dir):
|
||||||
"""
|
"""
|
||||||
Checks for the tts directory, and will create it if it does not exist
|
Checks for the tts directory, and will create it if it does not exist
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user