Adapt to new server

This commit is contained in:
3djc
2018-06-12 10:26:32 +02:00
parent fd9ecc589e
commit 2de9c62083
+17 -13
View File
@@ -23,6 +23,9 @@ from gtts import gTTS
from tts_common import *
board = "taranis"
reload(sys)
sys.setdefaultencoding('utf8')
SOURCE_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.abspath(os.path.join(SOURCE_DIRECTORY, '..', '..', 'radio', 'util'))
sys.path.append(lib_path)
@@ -101,7 +104,7 @@ if __name__ == "__main__":
if "csv" in sys.argv:
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
if not os.path.exists(path):
os.makedirs(path)
os.makedirs(path)
os.chdir(path)
with open("%s-%s.csv" % (voice, board), "wb") as csvFile:
for s, f in systemSounds:
@@ -122,7 +125,7 @@ if __name__ == "__main__":
if "psv" in sys.argv:
path = "/tmp/SOUNDS/" + directory + "/"
if not os.path.exists(path):
os.makedirs(path)
os.makedirs(path)
os.chdir(path)
with open("%s-%s.psv" % (voice, board), "wb") as csvFile:
for s, f in systemSounds:
@@ -134,15 +137,16 @@ if __name__ == "__main__":
l = u"|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
csvFile.write(l.encode("windows-1251"))
if "files" in sys.argv:
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
if not os.path.exists(path):
os.makedirs(path)
os.chdir(path)
for s, f in systemSounds:
if s and f:
generate(s, f)
os.chdir("..")
for s, f in sounds:
if s and f:
generate(s, f)
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
if not os.path.exists(path):
os.makedirs(path)
os.chdir(path)
for s, f in systemSounds:
if s and f:
generate(s, f)
os.chdir("..")
for s, f in sounds:
if s and f:
generate(s, f)