示例#1
0
文件: admin.py 项目: alphabernd/PyRfK
def liquidsoap_shutdown():
    try:
        client = LiquidDaemonClient()
        client.connect()
        client.shutdown_daemon()
        client.close()
        return jsonify({'status': 'done'})
    except Exception as e:
        return jsonify({'error': str(e)})
示例#2
0
文件: admin.py 项目: polarbernd/PyRfK
def liquidsoap_shutdown():
    try:
        client = LiquidDaemonClient()
        client.connect()
        client.shutdown_daemon()
        client.close()
        return jsonify({'status': 'done'})
    except Exception as e:
        return jsonify({'error': str(e)})
示例#3
0
文件: admin.py 项目: alphabernd/PyRfK
def liquidsoap_log():
    try:
        client = LiquidDaemonClient()
        client.connect()
        offset = request.args.get('offset')
        if offset is not None:
            offset = int(offset)
        
        offset, log = client.get_log(offset)
        client.close()
        lines = []
        for line in log:
            ts = to_user_timezone(datetime.utcfromtimestamp(int(line[0])))
            lines.append((ts.isoformat(), line[3]))
        return jsonify({'log': lines, 'offset': offset})
    except Exception as e:
        return jsonify({'error': str(e)})
示例#4
0
文件: admin.py 项目: polarbernd/PyRfK
def liquidsoap_log():
    try:
        client = LiquidDaemonClient()
        client.connect()
        offset = request.args.get('offset')
        if offset is not None:
            offset = int(offset)

        offset, log = client.get_log(offset)
        client.close()
        lines = []
        for line in log:
            ts = to_user_timezone(datetime.utcfromtimestamp(int(line[0])))
            lines.append((ts.isoformat(), line[3]))
        return jsonify({'log': lines, 'offset': offset})
    except Exception as e:
        return jsonify({'error': str(e)})