Exemplo n.º 1
0
def make_events_relative(string):
    events = []
    output = []
    while (string != ""):
        e, string = parser.parse_event(string)
        events.append(e)
    for e in events:
        e.set_unixtimestamp(e.unixtimestamp() - __t0__)
        output.append(pp.render_event(e))
    return ("".join(output))
Exemplo n.º 2
0
def make_events_relative(string):
    events = []
    output = []
    while (string != ""):
        e, string = parser.parse_event(string)
        events.append(e)
    for e in events:
        e.set_unixtimestamp(e.unixtimestamp() - __t0__)
        output.append(pp.render_event(e))
    return("".join(output))
Exemplo n.º 3
0
def test_render_event():
    t = random.randint(0, 10)
    v = random.random()
    e = event.Event("foobar", v, t)
    eq_("event 6|foobar %s %s.0;" % (repr(v), e.unixtimestamp()), pp.render_event(e))
Exemplo n.º 4
0
def test_render_event():
    t = random.randint(0, 10)
    v = random.random()
    e = event.Event("foobar", v, t)
    eq_("event 6|foobar %s %s.0;" % (repr(v), e.unixtimestamp()),
        pp.render_event(e))