Пример #1
0
    media_q = Queue()

    pmh = PypoMessageHandler(pypoFetch_q, recorder_q, config)
    pmh.daemon = True
    pmh.start()

    pfile = PypoFile(media_q, config)
    pfile.daemon = True
    pfile.start()

    pf = PypoFetch(pypoFetch_q, pypoPush_q, media_q, telnet_lock,
                   pypo_liquidsoap, config)
    pf.daemon = True
    pf.start()

    pp = PypoPush(pypoPush_q, telnet_lock, pypo_liquidsoap, config)
    pp.daemon = True
    pp.start()

    recorder = Recorder(recorder_q)
    recorder.daemon = True
    recorder.start()

    stat = ListenerStat()
    stat.daemon = True
    stat.start()

    pf.join()

    logger.info("System exit")
Пример #2
0
    """
    media_q = Queue()

    pmh = PypoMessageHandler(pypoFetch_q, recorder_q)
    pmh.daemon = True
    pmh.start()

    pfile = PypoFile(media_q)
    pfile.daemon = True
    pfile.start()

    pf = PypoFetch(pypoFetch_q, pypoPush_q, media_q, telnet_lock)
    pf.daemon = True
    pf.start()

    pp = PypoPush(pypoPush_q, telnet_lock)
    pp.daemon = True
    pp.start()

    recorder = Recorder(recorder_q)
    recorder.daemon = True
    recorder.start()

    stat = ListenerStat()
    stat.daemon = True
    stat.start()

    # all join() are commented out because we want to exit entire pypo
    # if pypofetch is exiting
    # pmh.join()
    # recorder.join()
Пример #3
0
    """
    media_q = Queue()

    pmh = PypoMessageHandler(pypoFetch_q, recorder_q)
    pmh.daemon = True
    pmh.start()

    pfile = PypoFile(media_q)
    pfile.daemon = True
    pfile.start()

    pf = PypoFetch(pypoFetch_q, pypoPush_q, media_q, telnet_lock)
    pf.daemon = True
    pf.start()

    pp = PypoPush(pypoPush_q, telnet_lock)
    pp.daemon = True
    pp.start()

    recorder = Recorder(recorder_q)
    recorder.daemon = True
    recorder.start()

    # all join() are commented out becase we want to exit entire pypo
    # if pypofetch is exiting
    #pmh.join()
    #recorder.join()
    #pp.join()
    pf.join()

    logger.info("pypo fetch exit")
Пример #4
0
    signal.signal(signal.SIGINT, keyboardInterruptHandler)

    # initialize
    g = Global()

    while not g.selfcheck(): time.sleep(5)
    
    logger = logging.getLogger()

    if options.test:
        g.test_api()
        sys.exit()

    q = Queue()

    pp = PypoPush(q)
    pp.start()

    pf = PypoFetch(q)
    pf.start()

    while True: time.sleep(3600)

    #pp.join()
    #pf.join()
"""
    if options.check:
        try: g.check_schedule()
        except Exception, e:
            print e
Пример #5
0
    # initialize
    g = Global()

    while not g.selfcheck():
        time.sleep(5)

    logger = logging.getLogger()

    if options.test:
        g.test_api()
        sys.exit()

    q = Queue()

    pp = PypoPush(q)
    pp.start()

    pf = PypoFetch(q)
    pf.start()

    while True:
        time.sleep(3600)

    #pp.join()
    #pf.join()
"""
    if options.check:
        try: g.check_schedule()
        except Exception, e:
            print e
Пример #6
0
from pypopush import PypoPush
from threading import Lock
from Queue import Queue

import datetime

pypoPush_q = Queue()
telnet_lock = Lock()

pp = PypoPush(pypoPush_q, telnet_lock)


def test_modify_cue_in():
    link = pp.modify_first_link_cue_point([])
    assert len(link) == 0

    min_ago = datetime.datetime.now() - datetime.timedelta(minutes=1)
    link = [{
        "start": min_ago.strftime("%Y-%m-%d-%H-%M-%S"),
        "cue_in": "0",
        "cue_out": "30"
    }]
    link = pp.modify_first_link_cue_point(link)
    assert len(link) == 0

    link = [{
        "start": min_ago.strftime("%Y-%m-%d-%H-%M-%S"),
        "cue_in": "0",
        "cue_out": "70"
    }]
    link = pp.modify_first_link_cue_point(link)