예제 #1
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)})
예제 #2
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)})
예제 #3
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)})
예제 #4
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)})