Files
ths-speech/python-server/server_interface.py
2018-08-20 05:55:49 +02:00

51 lines
1.3 KiB
Python

def parse_request(data):
''' parse request and call correct function '''
# echo/test connection
cleared_data = is_data_type(b"ECHOREQUEST,",data)
if cleared_data:
return cleared_data
# other shit
return b"UNRECOGNIZED_SERVER_OPTION\n"
def is_data_type(tag,data):
print(data)
print(tag)
data = data.strip(b"\n")
if data.startswith(tag):
ret = data.strip(tag)
if not ret:
ret = b"NULL\n"
return ret
return None
def reply_logs(loglevel=0,lines=100):
''' replies with recent logs '''
pass
def reply_backend(backend=None):
''' replies with current backend if None or sets the new one '''
pass
def reply_files(after=None, before=None, regex=None):
''' replies with a list of transcribed or to be transcribed files '''
def reply_transcript(filename=None):
''' replies with the latest transcript or the transcript of the chosen name '''
pass
def reply_audio(filename=None):
''' replies with the chosen audio as a file '''
pass
def recive_transcribe_request(audiofile):
''' saves and transcribes and audiofile '''
pass
def android_unittest_transcribe_request(audiofile):
''' the android unittests append a special keyword, requests are dummy handled '''