@@ -0,0 +1,834 @@
+#!/usr/bin/env python%0Aimport os%0Aimport struct%0Aimport time%0Afrom collections import defaultdict%0Afrom panda.lib.panda import Panda%0A%0A# fake%0Adef sec_since_boot():%0A  return time.time()%0A%0Adef can_printer():%0A  p = Panda()%0A%0A  start = sec_since_boot()%0A  lp = sec_since_boot()%0A  msgs = defaultdict(list)%0A  canbus = int(os.getenv(%22CAN%22, 0))%0A  while 1:%0A    can_recv = p.can_recv()%0A    for address, _, dat, src  in can_recv:%0A      if src == canbus:%0A        msgs%5Baddress%5D.append(dat)%0A%0A    if sec_since_boot() - lp %3E 0.1:%0A      dd = chr(27) + %22%5B2J%22%0A      dd += %22%255.2f%5Cn%22 %25 (sec_since_boot() - start)%0A      for k,v in sorted(zip(msgs.keys(), map(lambda x: x%5B-1%5D.encode(%22hex%22), msgs.values()))):%0A        dd += %22%25s(%256d) %25s%5Cn%22 %25 (%22%2504X(%254d)%22 %25 (k,k),len(msgs%5Bk%5D), v)%0A      print dd%0A      lp = sec_since_boot()%0A%0Aif __name__ == %22__main__%22:%0A  can_printer()%0A%0A

add can printer to panda tests