Skip to content

Commit 338d211

Browse files
authored
Merge pull request hardbyte#242 - release v2.1.0
2 parents 6913c49 + 9ca4952 commit 338d211

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1449
-639
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ coverage.xml
5555
*.log
5656

5757
# Sphinx documentation
58-
docs/_build/
58+
doc/_build/
5959

6060
# PyBuilder
6161
target/

.travis.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,47 @@
11
language: python
2-
sudo: false
2+
33
python:
4+
# CPython:
45
- "2.7"
5-
- "pypy"
6-
- "pypy3"
6+
- "3.3"
77
- "3.4"
88
- "3.5"
99
- "3.6"
10-
- "3.7-dev"
10+
- "3.7-dev" # TODO: change to "3.7" once it gets released
1111
- "nightly"
12+
# PyPy:
13+
- "pypy"
14+
- "pypy3"
15+
16+
os:
17+
- linux # Linux is officially supported and we test the library under
18+
# many different Python verions (see "python: ..." above)
19+
20+
# - osx # OSX + Python is not officially supported by Travis CI as of Feb. 2018
21+
# nevertheless, "nightly" and some "*-dev" versions seem to work, so we
22+
# include them explicitly below (see "matrix: include: ..." below)
23+
24+
# - windows # Windows is not supported at all by Travis CI as of Feb. 2018
25+
26+
# Linux setup
27+
dist: trusty
28+
sudo: false
29+
30+
matrix:
31+
# see "os: ..." above
32+
include:
33+
- os: osx
34+
python: "3.6-dev"
35+
- os: osx
36+
python: "3.7-dev"
37+
- os: osx
38+
python: "nightly"
39+
40+
# allow all nighly builds to fail, since these python versions might be unstable
41+
# we do not allow dev builds to fail, since these builds are stable enough
42+
allow_failures:
43+
- python: "nightly"
44+
1245
install:
1346
- travis_retry pip install .
1447
- travis_retry pip install -r requirements.txt

CHANGELOG.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Version 2.1.0 (2018-02-17)
2+
=====
3+
4+
* Support for out of tree can interfaces with pluggy.
5+
* Initial support for CAN-FD for socketcan_native and kvaser interfaces.
6+
* Neovi interface now uses Intrepid Control Systems's own interface library.
7+
* Improvements and new documentation for SQL reader/writer.
8+
* Fix bug in neovi serial number decoding.
9+
* Add testing on OSX to TravisCI
10+
* Fix non english decoding error on pcan
11+
* Other misc improvements and bug fixes
12+
13+
14+
Version 2.0.0 (2018-01-05
15+
=====
16+
17+
After an extended baking period we have finally tagged version 2.0.0!
18+
19+
Quite a few major Changes from v1.x:
20+
21+
* New interfaces:
22+
* Vector
23+
* NI-CAN
24+
* isCAN
25+
* neoVI
26+
* Simplified periodic send API with initial support for SocketCAN
27+
* Protocols module including J1939 support removed
28+
* Logger script moved to module `can.logger`
29+
* New `can.player` script to replay log files
30+
* BLF, ASC log file support added in new `can.io` module
31+
32+
You can install from [PyPi](https://pypi.python.org/pypi/python-can/2.0.0) with pip:
33+
34+
```
35+
pip install python-can==2.0.0
36+
```
37+
38+
The documentation for v2.0.0 is available at http://python-can.readthedocs.io/en/2.0.0/

CONTRIBUTORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ Giuseppe Corbelli <[email protected]>
1919
Christian Sandberg
2020
Eduard Bröcker <[email protected]>
2121
Boris Wenzlaff
22+
Pierre-Luc Tessier Gagné
23+
Felix Divo <[email protected]>

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ python-can
1212
:alt: Documentation Status
1313

1414
.. |build| image:: https://travis-ci.org/hardbyte/python-can.svg?branch=develop
15-
:target: https://travis-ci.org/hardbyte/python-can
15+
:target: https://travis-ci.org/hardbyte/python-can/branches
1616
:alt: CI Server for develop branch
1717

1818

@@ -26,7 +26,7 @@ Python developers; providing `common abstractions to
2626
different hardware devices`, and a suite of utilities for sending and receiving
2727
messages on a can bus.
2828

29-
The library supports Python 2.7, Python 3.3+ and runs on Mac, Linux and Windows.
29+
The library supports Python 2.7, Python 3.3+ as well as PyPy and runs on Mac, Linux and Windows.
3030

3131
You can find more information in the documentation, online at
3232
`python-can.readthedocs.org <https://python-can.readthedocs.org/en/stable/>`__.
@@ -46,3 +46,8 @@ questions and answers tagged with ``python+can``.
4646

4747
Wherever we interact, we strive to follow the
4848
`Python Community Code of Conduct <https://www.python.org/psf/codeofconduct/>`__.
49+
50+
Contributing
51+
------------
52+
53+
See `doc/development.rst <doc/development.rst>`__ for getting started.

can/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import logging
77

8-
__version__ = "2.0.0"
8+
__version__ = "2.1.0"
99

1010
log = logging.getLogger('can')
1111

@@ -22,7 +22,7 @@ class CanError(IOError):
2222
from can.io import BLFReader, BLFWriter
2323
from can.io import CanutilsLogReader, CanutilsLogWriter
2424
from can.io import CSVWriter
25-
from can.io import SqliteWriter, SqlReader
25+
from can.io import SqliteWriter, SqliteReader
2626

2727
from can.util import set_logging_level
2828

can/bus.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import print_function, absolute_import
32

3+
"""
4+
Contains the ABC bus implementation.
5+
"""
6+
7+
from __future__ import print_function, absolute_import
48
import abc
59
import logging
610
import threading
711
from can.broadcastmanager import ThreadBasedCyclicSendTask
12+
13+
814
logger = logging.getLogger(__name__)
915

1016

@@ -17,7 +23,6 @@ class BusABC(object):
1723
1824
As well as setting the `channel_info` attribute to a string describing the
1925
interface.
20-
2126
"""
2227

2328
#: a string describing the underlying bus channel
@@ -40,6 +45,10 @@ def __init__(self, channel=None, can_filters=None, **config):
4045
:param dict config:
4146
Any backend dependent configurations are passed in this dictionary
4247
"""
48+
pass
49+
50+
def __str__(self):
51+
return self.channel_info
4352

4453
@abc.abstractmethod
4554
def recv(self, timeout=None):
@@ -104,10 +113,9 @@ def __iter__(self):
104113
:yields: :class:`can.Message` msg objects.
105114
"""
106115
while True:
107-
m = self.recv(timeout=1.0)
108-
if m is not None:
109-
yield m
110-
logger.debug("done iterating over bus messages")
116+
msg = self.recv(timeout=1.0)
117+
if msg is not None:
118+
yield msg
111119

112120
def set_filters(self, can_filters=None):
113121
"""Apply filtering to all messages received by this Bus.

can/interface.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import importlib
55

66
from can.broadcastmanager import CyclicSendTaskABC, MultiRateCyclicSendTaskABC
7+
from pkg_resources import iter_entry_points
78
from can.util import load_config
89

910
# interface_name => (module, classname)
@@ -18,12 +19,18 @@
1819
'nican': ('can.interfaces.nican', 'NicanBus'),
1920
'iscan': ('can.interfaces.iscan', 'IscanBus'),
2021
'virtual': ('can.interfaces.virtual', 'VirtualBus'),
21-
'neovi': ('can.interfaces.neovi_api', 'NeoVIBus'),
22+
'neovi': ('can.interfaces.ics_neovi', 'NeoViBus'),
2223
'vector': ('can.interfaces.vector', 'VectorBus'),
2324
'slcan': ('can.interfaces.slcan', 'slcanBus')
2425
}
2526

2627

28+
BACKENDS.update({
29+
interface.name: (interface.module_name, interface.attrs[0])
30+
for interface in iter_entry_points('python_can.interface')
31+
})
32+
33+
2734
class Bus(object):
2835
"""
2936
Instantiates a CAN Bus of the given `bustype`, falls back to reading a

can/interfaces/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"""
33
Interfaces contain low level implementations that interact with CAN hardware.
44
"""
5+
from pkg_resources import iter_entry_points
56

67
VALID_INTERFACES = set(['kvaser', 'serial', 'pcan', 'socketcan_native',
78
'socketcan_ctypes', 'socketcan', 'usb2can', 'ixxat',
8-
'nican', 'iscan', 'vector', 'virtual', 'neovi','slcan'])
9+
'nican', 'iscan', 'vector', 'virtual', 'neovi',
10+
'slcan'])
11+
12+
13+
VALID_INTERFACES.update(set([
14+
interface.name for interface in iter_entry_points('python_can.interface')
15+
]))

can/interfaces/ics_neovi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from can.interfaces.ics_neovi.neovi_bus import NeoViBus

0 commit comments

Comments
 (0)