File: simple_log_converter.py

package info (click to toggle)
python-can 3.0.0%2Bgithub-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,892 kB
  • sloc: python: 8,014; makefile: 29; sh: 12
file content (19 lines) | stat: -rwxr-xr-x 355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
# coding: utf-8

"""
Use this to convert .can/.asc files to .log files.

Usage: simpleLogConvert.py sourceLog.asc targetLog.log
"""

import sys

import can.io.logger
import can.io.player

reader = can.io.player.LogReader(sys.argv[1])
writer = can.io.logger.Logger(sys.argv[2])

for msg in reader:
    writer.on_message_received(msg)