Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bee6d4d
add extra dependency
danielhrisca Feb 18, 2019
4c3d917
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca Apr 14, 2019
1fc9bf2
add mf4 io writer
danielhrisca Apr 18, 2019
07c0a4c
Merge remote-tracking branch 'remotes/upstrem/develop' into mf4_io
danielhrisca Apr 18, 2019
ad33863
update asammdf requirement
danielhrisca Apr 18, 2019
b6f73af
add missing comma in setup.py
danielhrisca Apr 22, 2019
70f1be4
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca Apr 22, 2019
26cd255
changes after initial review
danielhrisca Apr 22, 2019
74e8472
simplify append call
danielhrisca Apr 22, 2019
59c3db9
add MF4Reader class
danielhrisca Apr 22, 2019
efdfdc9
start testing
danielhrisca Apr 22, 2019
38d67ac
passes tests
danielhrisca Apr 22, 2019
a11440b
update documentation
danielhrisca Apr 22, 2019
b736542
update docs and CI scripts
danielhrisca Apr 23, 2019
c2db9f6
retrigger build
danielhrisca Apr 25, 2019
3953060
Merge branch 'develop' into mf4_io
felixdivo Apr 27, 2019
72469fc
Merge branch 'develop' into mf4_io
felixdivo Apr 30, 2019
ddbb985
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca May 1, 2019
08cd68c
Merge branch 'develop' into mf4_io
felixdivo May 3, 2019
b1e7d5c
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca May 6, 2019
2a2e77e
update setup.py according to review
danielhrisca May 6, 2019
a2937bb
Merge branch 'mf4_io' of https://github.com/danielhrisca/python-can i…
danielhrisca May 6, 2019
be0d168
remove debug save file
danielhrisca May 6, 2019
9f7e6b4
install and test mf4
danielhrisca May 6, 2019
2d74d3c
Merge branch 'develop' into mf4_io
felixdivo May 8, 2019
368c505
changes after review
danielhrisca May 12, 2019
afd20d7
Merge branch 'develop' into mf4_io
danielhrisca May 12, 2019
dff0f69
Merge branch 'develop' into mf4_io
felixdivo May 18, 2019
a8abbf0
updates after review
danielhrisca May 18, 2019
74b6c6f
Merge branch 'develop' into mf4_io
hardbyte May 19, 2019
8c60906
Merge branch 'develop' into mf4_io
felixdivo May 19, 2019
3be4d52
Merge branch 'develop' into mf4_io
felixdivo May 19, 2019
70614d9
Merge branch 'develop' into mf4_io
felixdivo May 20, 2019
29b293a
Merge branch 'develop' into mf4_io
felixdivo Jun 9, 2019
b155217
Merge branch 'develop' into mf4_io
felixdivo Jun 12, 2019
683f464
Merge branch 'develop' into mf4_io
felixdivo Jun 22, 2019
d70b2bf
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca Jun 28, 2019
11ca866
Merge branch 'develop' into mf4_io
danielhrisca Jul 10, 2019
bb4813c
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca Jul 10, 2019
c9a4a57
add cython requirement
danielhrisca Jul 10, 2019
3a3a7d9
Merge branch 'mf4_io' of https://github.com/danielhrisca/python-can i…
danielhrisca Jul 10, 2019
7085a3d
Merge branch 'develop' into mf4_io
felixdivo Jul 14, 2019
74a2759
Merge branch 'mf4-io' into mf4_io
felixdivo Sep 4, 2019
84bc803
Merge branch 'develop' of https://github.com/hardbyte/python-can into…
danielhrisca Sep 30, 2019
9901b77
fixes after review:
danielhrisca Sep 30, 2019
0ade546
Merge branch 'mf4_io' of https://github.com/danielhrisca/python-can i…
danielhrisca Sep 30, 2019
ceb3305
add MF4Writer and MF4Reader to logger and player modules
danielhrisca Sep 30, 2019
355783f
reformat and change setup.py accordingly
felixdivo Sep 4, 2019
90f9ecf
cleanup test file
felixdivo Sep 4, 2019
d06cc52
cleanup docs
felixdivo Sep 4, 2019
d9d43c1
remove orphaned pip extention
felixdivo Sep 4, 2019
e42126c
cleanups and fix linter problems
felixdivo Sep 4, 2019
22f3d64
re-add change to can.io.Logger; it somehow went lost while rebasing
felixdivo Oct 3, 2019
5cb4b63
remove leftover __future__ import
felixdivo Oct 3, 2019
c311af4
fix typing error in can.io's player.py and logger.py
felixdivo Oct 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install:
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%

# We need to install the python-can library itself including the dependencies
- "python -m pip install .[test,neovi]"
- "python -m pip install .[test,neovi,mf4]"

build: off

Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
# -a Write all files
# -n nitpicky
- python -m sphinx -an doc build

- stage: linter
name: "Linter Checks"
python: "3.7"
Expand All @@ -85,6 +86,8 @@ jobs:
# Slowly enable all pylint warnings by adding addressed classes of
# warnings to the .pylintrc-wip file to prevent them from being
# re-introduced


# check the entire main codebase
- pylint --rcfile=.pylintrc-wip can/**.py
# check setup.py
Expand Down Expand Up @@ -116,13 +119,15 @@ jobs:
can/io/**.py
scripts/**.py
examples/**.py

- stage: linter
name: "Formatting Checks"
python: "3.7"
before_install:
- travis_retry pip install -r requirements-lint.txt
script:
- black --check --verbose .

- stage: deploy
name: "PyPi Deployment"
python: "3.7"
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Features
- receiving, sending, and periodically sending messages
- normal and extended arbitration IDs
- limited `CAN FD <https://en.wikipedia.org/wiki/CAN_FD>`__ support
- many different loggers and readers supporting playback: ASC (CANalyzer format), BLF (Binary Logging Format by Vector), CSV, SQLite and Canutils log
- many different loggers and readers supporting playback: ASC (CANalyzer format), BLF (Binary Logging Format by Vector), CSV, SQLite, Canutils log and MF4 (Measurement Data Format v4 by ASAM)
- efficient in-kernel or in-hardware filtering of messages on supported interfaces
- bus configuration reading from file or environment variables
- CLI tools for working with CAN buses (see the `docs <https://python-can.readthedocs.io/en/stable/scripts.html>`__)
Expand Down
5 changes: 5 additions & 0 deletions can/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class CanError(IOError):
from .io import CSVWriter, CSVReader
from .io import SqliteWriter, SqliteReader

try:
from .io import MF4Writer, MF4Reader
except ImportError:
pass

from .util import set_logging_level

from .message import Message
Expand Down
5 changes: 5 additions & 0 deletions can/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@
from .csv import CSVWriter, CSVReader
from .sqlite import SqliteReader, SqliteWriter
from .printer import Printer

try:
from .mf4 import MF4Writer, MF4Reader
except ImportError:
pass
15 changes: 15 additions & 0 deletions can/io/logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# coding: utf-8

"""
See the :class:`Logger` class.
"""

import logging
import pathlib
import typing

Expand All @@ -16,6 +19,12 @@
from .sqlite import SqliteWriter
from .printer import Printer

try:
from .mf4 import MF4Writer
except ImportError:
# be careful when using MF4Writer, it might NameError
pass


class Logger(BaseIOHandler, Listener): # pylint: disable=abstract-method
"""
Expand All @@ -27,6 +36,7 @@ class Logger(BaseIOHandler, Listener): # pylint: disable=abstract-method
* .csv: :class:`can.CSVWriter`
* .db: :class:`can.SqliteWriter`
* .log :class:`can.CanutilsLogWriter`
* .mf4 :class:`can.MF4Writer`
* .txt :class:`can.Printer`

The **filename** may also be *None*, to fall back to :class:`can.Printer`.
Expand Down Expand Up @@ -59,6 +69,11 @@ def __new__(
".log": CanutilsLogWriter,
".txt": Printer,
}
try:
lookup[".mf4"] = MF4Writer
except NameError:
pass

suffix = pathlib.PurePath(filename).suffix
try:
return lookup[suffix](filename, *args, **kwargs)
Expand Down
Loading