Skip to content

Commit

Permalink
Merge pull request #242 - release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hardbyte authored Feb 18, 2018
2 parents 6913c49 + 9ca4952 commit 338d211
Show file tree
Hide file tree
Showing 48 changed files with 1,449 additions and 639 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ coverage.xml
*.log

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/
Expand Down
41 changes: 37 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
language: python
sudo: false

python:
# CPython:
- "2.7"
- "pypy"
- "pypy3"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
- "3.7-dev" # TODO: change to "3.7" once it gets released
- "nightly"
# PyPy:
- "pypy"
- "pypy3"

os:
- linux # Linux is officially supported and we test the library under
# many different Python verions (see "python: ..." above)

# - osx # OSX + Python is not officially supported by Travis CI as of Feb. 2018
# nevertheless, "nightly" and some "*-dev" versions seem to work, so we
# include them explicitly below (see "matrix: include: ..." below)

# - windows # Windows is not supported at all by Travis CI as of Feb. 2018

# Linux setup
dist: trusty
sudo: false

matrix:
# see "os: ..." above
include:
- os: osx
python: "3.6-dev"
- os: osx
python: "3.7-dev"
- os: osx
python: "nightly"

# allow all nighly builds to fail, since these python versions might be unstable
# we do not allow dev builds to fail, since these builds are stable enough
allow_failures:
- python: "nightly"

install:
- travis_retry pip install .
- travis_retry pip install -r requirements.txt
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Version 2.1.0 (2018-02-17)
=====

* Support for out of tree can interfaces with pluggy.
* Initial support for CAN-FD for socketcan_native and kvaser interfaces.
* Neovi interface now uses Intrepid Control Systems's own interface library.
* Improvements and new documentation for SQL reader/writer.
* Fix bug in neovi serial number decoding.
* Add testing on OSX to TravisCI
* Fix non english decoding error on pcan
* Other misc improvements and bug fixes


Version 2.0.0 (2018-01-05
=====

After an extended baking period we have finally tagged version 2.0.0!

Quite a few major Changes from v1.x:

* New interfaces:
* Vector
* NI-CAN
* isCAN
* neoVI
* Simplified periodic send API with initial support for SocketCAN
* Protocols module including J1939 support removed
* Logger script moved to module `can.logger`
* New `can.player` script to replay log files
* BLF, ASC log file support added in new `can.io` module

You can install from [PyPi](https://pypi.python.org/pypi/python-can/2.0.0) with pip:

```
pip install python-can==2.0.0
```

The documentation for v2.0.0 is available at http://python-can.readthedocs.io/en/2.0.0/
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ Giuseppe Corbelli <[email protected]>
Christian Sandberg
Eduard Bröcker <[email protected]>
Boris Wenzlaff
Pierre-Luc Tessier Gagné
Felix Divo <[email protected]>
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python-can
:alt: Documentation Status

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


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

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

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

Wherever we interact, we strive to follow the
`Python Community Code of Conduct <https://www.python.org/psf/codeofconduct/>`__.

Contributing
------------

See `doc/development.rst <doc/development.rst>`__ for getting started.
4 changes: 2 additions & 2 deletions can/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging

__version__ = "2.0.0"
__version__ = "2.1.0"

log = logging.getLogger('can')

Expand All @@ -22,7 +22,7 @@ class CanError(IOError):
from can.io import BLFReader, BLFWriter
from can.io import CanutilsLogReader, CanutilsLogWriter
from can.io import CSVWriter
from can.io import SqliteWriter, SqlReader
from can.io import SqliteWriter, SqliteReader

from can.util import set_logging_level

Expand Down
20 changes: 14 additions & 6 deletions can/bus.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import

"""
Contains the ABC bus implementation.
"""

from __future__ import print_function, absolute_import
import abc
import logging
import threading
from can.broadcastmanager import ThreadBasedCyclicSendTask


logger = logging.getLogger(__name__)


Expand All @@ -17,7 +23,6 @@ class BusABC(object):
As well as setting the `channel_info` attribute to a string describing the
interface.
"""

#: a string describing the underlying bus channel
Expand All @@ -40,6 +45,10 @@ def __init__(self, channel=None, can_filters=None, **config):
:param dict config:
Any backend dependent configurations are passed in this dictionary
"""
pass

def __str__(self):
return self.channel_info

@abc.abstractmethod
def recv(self, timeout=None):
Expand Down Expand Up @@ -104,10 +113,9 @@ def __iter__(self):
:yields: :class:`can.Message` msg objects.
"""
while True:
m = self.recv(timeout=1.0)
if m is not None:
yield m
logger.debug("done iterating over bus messages")
msg = self.recv(timeout=1.0)
if msg is not None:
yield msg

def set_filters(self, can_filters=None):
"""Apply filtering to all messages received by this Bus.
Expand Down
9 changes: 8 additions & 1 deletion can/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import importlib

from can.broadcastmanager import CyclicSendTaskABC, MultiRateCyclicSendTaskABC
from pkg_resources import iter_entry_points
from can.util import load_config

# interface_name => (module, classname)
Expand All @@ -18,12 +19,18 @@
'nican': ('can.interfaces.nican', 'NicanBus'),
'iscan': ('can.interfaces.iscan', 'IscanBus'),
'virtual': ('can.interfaces.virtual', 'VirtualBus'),
'neovi': ('can.interfaces.neovi_api', 'NeoVIBus'),
'neovi': ('can.interfaces.ics_neovi', 'NeoViBus'),
'vector': ('can.interfaces.vector', 'VectorBus'),
'slcan': ('can.interfaces.slcan', 'slcanBus')
}


BACKENDS.update({
interface.name: (interface.module_name, interface.attrs[0])
for interface in iter_entry_points('python_can.interface')
})


class Bus(object):
"""
Instantiates a CAN Bus of the given `bustype`, falls back to reading a
Expand Down
9 changes: 8 additions & 1 deletion can/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"""
Interfaces contain low level implementations that interact with CAN hardware.
"""
from pkg_resources import iter_entry_points

VALID_INTERFACES = set(['kvaser', 'serial', 'pcan', 'socketcan_native',
'socketcan_ctypes', 'socketcan', 'usb2can', 'ixxat',
'nican', 'iscan', 'vector', 'virtual', 'neovi','slcan'])
'nican', 'iscan', 'vector', 'virtual', 'neovi',
'slcan'])


VALID_INTERFACES.update(set([
interface.name for interface in iter_entry_points('python_can.interface')
]))
1 change: 1 addition & 0 deletions can/interfaces/ics_neovi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from can.interfaces.ics_neovi.neovi_bus import NeoViBus
Loading

0 comments on commit 338d211

Please sign in to comment.