-Remove useless api_client interface
This commit is contained in:
parent
7ce4934cdc
commit
62287a2313
9 changed files with 28 additions and 156 deletions
|
@ -1,7 +1,6 @@
|
|||
import logging
|
||||
import sys
|
||||
from api_clients import api_client
|
||||
from configobj import ConfigObj
|
||||
|
||||
def generate_liquidsoap_config(ss):
|
||||
data = ss['msg']
|
||||
|
@ -10,30 +9,22 @@ def generate_liquidsoap_config(ss):
|
|||
fh.write("# THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #\n")
|
||||
fh.write("################################################\n")
|
||||
for d in data:
|
||||
buffer = d[u'keyname'] + " = "
|
||||
str_buffer = d[u'keyname'] + " = "
|
||||
if(d[u'type'] == 'string'):
|
||||
temp = d[u'value']
|
||||
buffer += '"%s"' % temp
|
||||
str_buffer += '"%s"' % temp
|
||||
else:
|
||||
temp = d[u'value']
|
||||
if(temp == ""):
|
||||
temp = "0"
|
||||
buffer += temp
|
||||
buffer += "\n"
|
||||
fh.write(api_client.encode_to(buffer))
|
||||
str_buffer += temp
|
||||
str_buffer += "\n"
|
||||
fh.write(api_client.encode_to(str_buffer))
|
||||
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
||||
fh.close()
|
||||
|
||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
logging.basicConfig(format='%(message)s')
|
||||
ac = api_client.api_client_factory(config, logging.getLogger())
|
||||
ac = api_client(logging.getLogger())
|
||||
ss = ac.get_stream_setting()
|
||||
|
||||
if ss is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue