92 lines
2.7 KiB
Python
92 lines
2.7 KiB
Python
import config
|
|
import utilities_script as utilities
|
|
|
|
class Chyron_Module():
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.chyron_computedString = ""
|
|
self.chyron_items:list = []
|
|
|
|
def chyron_stringUpdater(self):
|
|
newString = ""
|
|
for c in self.chyron_items:
|
|
c.item_stringUpdater()
|
|
newString = newString + c.itemComputedString
|
|
for x in range(config.chyronListSpaceCount):
|
|
newString = newString + " "
|
|
self.chyron_computedString = newString
|
|
|
|
def addItem(self, name, title, content):
|
|
newItem:ChyronItem = ChyronItem()
|
|
newItem.setupItem(name, title, content)
|
|
self.chyron_items.append(newItem)
|
|
|
|
def removeItem(self, name):
|
|
for c in self.chyron_items:
|
|
if c.itemName == name:
|
|
self.chyron_items.remove(c)
|
|
|
|
def updateChyronFile(self):
|
|
dir = utilities.get_dir("stream_sources")
|
|
|
|
|
|
class ChyronItem():
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.itemName = ""
|
|
|
|
self.includeTitle = True
|
|
self.itemTitle = ""
|
|
self.itemContent = ""
|
|
|
|
self.itemComputedString = ""
|
|
|
|
def setupItem(self, name, title, content):
|
|
print("Setting up Item {", name,"}[", title, content, "]")
|
|
self.itemName = name
|
|
self.itemTitle = title
|
|
self.itemContent = content
|
|
|
|
def item_stringUpdater(self):
|
|
newString = ""
|
|
if self.includeTitle == True:
|
|
newString = newString + self.itemTitle
|
|
newString = newString + self.itemContent
|
|
self.itemComputedString = newString
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
testModule = Chyron_Module()
|
|
testModule.addItem(
|
|
"RightNow",
|
|
"Now: ",
|
|
"Coding Stream")
|
|
testModule.addItem(
|
|
"WeekDays",
|
|
"► Weekdays: ",
|
|
"Daily Stream @ 12pm Noon EST")
|
|
testModule.addItem(
|
|
"FriSat",
|
|
"► Friday & Saturday: ",
|
|
"FFxiv (Express Delivery Raid Team) @ 7pm EST")
|
|
testModule.addItem(
|
|
"Commands",
|
|
"► Commands: ",
|
|
"!animal, !climateclock, !discord, !lights, !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()
|
|
|
|
test = testModule.chyron_computedString + "<<<|"
|
|
print(test) |