# Path: chirp/common/conf.py

# 
# Path: chirp/stream/barix.py
# def _remove_tags(html_str):
#     def __init__(self, host, port):
#     def ping(self):
# _CLIENT_RE = re.compile("(\d+\.\d+\.\d+\.\d+):src port (\d+) :dst port (\d+)")
#     TIMEOUT_S = 1.0
# class Barix(object):


import BaseHTTPServer
import logging
import os
import sys
import threading
import time
from chirp.common.conf import (BARIX_STATUS_HOST, BARIX_STATUS_PORT,
                                   BARIX_HOST, BARIX_PORT)
from chirp.stream import barix
        if len(level_history) > LEVEL_HISTORY_MAX_SIZE:
            level_history.pop(0)

        if log_fh:
            now = int(b_obj.last_update_time)
            ip, far_port = b_obj.clients.get("12345", ("None", 0))
            log_info = "%d %04x %s\n" % (now, int(far_port), ip)
            log_fh.write(log_info)
            log_fh.flush()

    except Exception, err:
        logging.exception("Swallowed exception")


def main():

    log_path = os.path.join(os.environ["HOME"], "live365_connection.log")
    log_fh = open(log_path, "a")

    _RequestHandler.barix = barix.Barix(BARIX_HOST, BARIX_PORT)

    srv = BaseHTTPServer.HTTPServer((BARIX_STATUS_HOST, BARIX_STATUS_PORT),
                                    _RequestHandler)
    srv.socket.settimeout(_TIMEOUT_S)
    done = threading.Event()
    th = threading.Thread(target=handle_requests, args=(srv, done))
    th.start()

    while True:
        try:

# Path: chirp/common/conf.py

# 
# Path: chirp/stream/barix.py
# def _remove_tags(html_str):
#     def __init__(self, host, port):
#     def ping(self):
# _CLIENT_RE = re.compile("(\d+\.\d+\.\d+\.\d+):src port (\d+) :dst port (\d+)")
#     TIMEOUT_S = 1.0
# class Barix(object):


# Path: chirp/stream/do_proxy_barix_status.py
import BaseHTTPServer
import logging
import os
import sys
import threading
import time
from chirp.common.conf import (BARIX_STATUS_HOST, BARIX_STATUS_PORT,
                                   BARIX_HOST, BARIX_PORT)
from chirp.stream import barix

        if len(level_history) > LEVEL_HISTORY_MAX_SIZE:
            level_history.pop(0)

        if log_fh:
            now = int(b_obj.last_update_time)
            ip, far_port = b_obj.clients.get("12345", ("None", 0))
            log_info = "%d %04x %s\n" % (now, int(far_port), ip)
            log_fh.write(log_info)
            log_fh.flush()

    except Exception, err:
        logging.exception("Swallowed exception")


def main():

    log_path = os.path.join(os.environ["HOME"], "live365_connection.log")
    log_fh = open(log_path, "a")

    _RequestHandler.barix = barix.Barix(BARIX_HOST, BARIX_PORT)

    srv = BaseHTTPServer.HTTPServer((BARIX_STATUS_HOST, BARIX_STATUS_PORT),
                                    _RequestHandler)
    srv.socket.settimeout(_TIMEOUT_S)
    done = threading.Event()
    th = threading.Thread(target=handle_requests, args=(srv, done))
    th.start()

    while True:
        try:

            poll_barix(_RequestHandler.barix, log_fh)