implement method stub
This commit is contained in:
parent
d205b0dbd3
commit
76a02796b7
|
@ -27,8 +27,16 @@ class TelnetLiquidsoap:
|
|||
def __connect(self):
|
||||
return telnetlib.Telnet(self.ls_host, self.ls_port)
|
||||
|
||||
def __is_empty(self, tn, queue_id):
|
||||
def __is_empty(self, queue_id):
|
||||
return True
|
||||
tn = self.__connect()
|
||||
msg = '%s.queue\nexit\n' % queue_id
|
||||
tn.write(msg)
|
||||
output = tn.read_all().splitlines()
|
||||
if len(output) == 3:
|
||||
return len(output[0]) == 0
|
||||
else:
|
||||
raise Exception("Unexpected list length returned: %s" % output)
|
||||
|
||||
def queue_clear_all(self):
|
||||
try:
|
||||
|
@ -67,11 +75,11 @@ class TelnetLiquidsoap:
|
|||
def queue_push(self, queue_id, media_item):
|
||||
try:
|
||||
self.telnet_lock.acquire()
|
||||
tn = self.__connect()
|
||||
|
||||
if not self.__is_empty(tn, queue_id):
|
||||
if not self.__is_empty(queue_id):
|
||||
raise QueueNotEmptyException()
|
||||
|
||||
tn = self.__connect()
|
||||
annotation = create_liquidsoap_annotation(media_item)
|
||||
msg = '%s.push %s\n' % (queue_id, annotation.encode('utf-8'))
|
||||
self.logger.debug(msg)
|
||||
|
|
Loading…
Reference in New Issue