69 lines
1.7 KiB
Python
69 lines
1.7 KiB
Python
from enum import Enum
|
|
from os import F_OK
|
|
import tempText_Module
|
|
import time
|
|
import config as config
|
|
import db
|
|
import tts
|
|
import threading
|
|
|
|
from flask import Flask
|
|
|
|
import credentials
|
|
|
|
import commands.loader as command_loader
|
|
from commands.command_base import AbstractCommand
|
|
|
|
from cooldowns import Cooldown_Module
|
|
|
|
import utilities_script as utility
|
|
|
|
import chyron_module
|
|
|
|
class webSource_Module():
|
|
webSources:Flask = Flask('webSources')
|
|
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.dbCredential: credentials.DB_Credential
|
|
|
|
def main(self, port_=5000):
|
|
print("starting up on port: ", port_)
|
|
self.webSources.run(host="0.0.0.0", port= port_)
|
|
|
|
@webSources.route('/')
|
|
def hello_world():
|
|
return 'I can see your Ghost!'
|
|
|
|
@webSources.route('/chyron')
|
|
def textSource_chyron():
|
|
tempModule = chyron_module.Chyron_Module()
|
|
return tempModule.getChyronFile()
|
|
|
|
@webSources.route('/temptext/<filename>/')
|
|
def textSource_tempText(filename):
|
|
print("trying file: ", filename)
|
|
tempModule = tempText_Module.tempText_Module()
|
|
return tempModule.getTempTextFile(filename)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
testModule = webSource_Module()
|
|
testModule_2 = webSource_Module()
|
|
threads = []
|
|
|
|
#credentials_manager = credentials.Credentials_Module()
|
|
#credentials_manager.load_credentials()
|
|
#testModule.dbCredential = credentials_manager.find_DB_Credential(config.credentialsNickname)
|
|
|
|
thread_ = threading.Thread(target=testModule.main(port_=5000))
|
|
threads.append(thread_)
|
|
thread_.start()
|
|
|
|
thread_2 = threading.Thread(target=testModule_2.main(port_=8000))
|
|
threads.append(thread_2)
|
|
thread_2.start()
|
|
|
|
for t in threads:
|
|
t.join() |