chyron file creation
This commit is contained in:
parent
684b22f451
commit
974385242f
@ -1,5 +1,6 @@
|
||||
import config
|
||||
import utilities_script as utilities
|
||||
import os
|
||||
|
||||
class Chyron_Module():
|
||||
def __init__(self):
|
||||
@ -15,6 +16,7 @@ class Chyron_Module():
|
||||
for x in range(config.chyronListSpaceCount):
|
||||
newString = newString + " "
|
||||
self.chyron_computedString = newString
|
||||
return newString
|
||||
|
||||
def addItem(self, name, title, content):
|
||||
newItem:ChyronItem = ChyronItem()
|
||||
@ -28,6 +30,14 @@ class Chyron_Module():
|
||||
|
||||
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():
|
||||
@ -89,4 +99,6 @@ if __name__ == "__main__":
|
||||
testModule.chyron_stringUpdater()
|
||||
|
||||
test = testModule.chyron_computedString + "<<<|"
|
||||
print(test)
|
||||
print(test)
|
||||
|
||||
testModule.updateChyronFile()
|
||||
Loading…
Reference in New Issue
Block a user