Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
19 changes: 10 additions & 9 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Major features
* Adds support for developing `asyncio` applications with `python-can` more easily. This can be useful
when implementing protocols that handles simultaneous connections to many nodes since you can write
synchronous looking code without handling multiple threads and locking mechanisms. #388
* New can viewer terminal application. #390
* New can viewer terminal application. (`python -m can.viewer`) #390
* More formally adds task management responsibility to the `Bus`. By default tasks created with
`bus.send_periodic` will have a reference held by the bus - this means in many cases the user
doesn't need to keep the task in scope for their periodic messages to continue being sent. If
Expand All @@ -18,11 +18,10 @@ Major features
Breaking changes
----------------

- Interfaces should no longer override `send_periodic` and instead implement
`_send_periodic_internal` #426
- writing to closed writers is not supported any more (it was supported only for some)
- the method `Listener.on_message_received()` is now abstract (using `@abc.abstractmethod`)
- the file in the reader/writer is now always stored in the attribute uniformly called `file`, and not in
* Interfaces should no longer override `send_periodic` and instead implement
`_send_periodic_internal` to allow the Bus base class to manage tasks. #426
* writing to closed writers is not supported any more (it was supported only for some)
* the file in the reader/writer is now always stored in the attribute uniformly called `file`, and not in
something like `fp`, `log_file` or `output_file`. Changed the name of the first parameter of the
read/writer constructors from `filename` to `file`.

Expand All @@ -31,8 +30,9 @@ Other notable changes
---------------------

* can.Message class updated #413
- Addition of a Message.equals method.
- Addition of a `Message.equals` method.
- Deprecate id_type in favor of is_extended_id
- Initializer parameter extended_id deprecated in favor of is_extended_id
- documentation, testing and example updates
- Addition of support for various builtins: __repr__, __slots__, __copy__
* IO module updates to bring consistency to the different CAN message writers and readers. #348
Expand All @@ -50,13 +50,14 @@ Other notable changes
and only buffers messages up to a certain limit before writing/committing to the database.
- the unused `header_line` attribute from `CSVReader` has been removed
- privatized some attributes that are only to be used internally in the classes
- the method `Listener.on_message_received()` is now abstract (using `@abc.abstractmethod`)
* Start testing against Python 3.7 #380
* All scripts have been moved into `can/scripts`. #370, #406
* Added support for additional sections to the config #338
* Code coverage reports added. #346, #374
* Bug fix to thread safe bus. #397

General fixes, cleanup and docs changes: (#347, #348, #367, #368, #370, #371, #373, #420, #417, #419)
General fixes, cleanup and docs changes: (#347, #348, #367, #368, #370, #371, #373, #420, #417, #419, #432)

Backend Specific Changes
------------------------
Expand Down Expand Up @@ -94,7 +95,7 @@ serial
socketcan
~~~~~~~~~

* socketcan tasks now reuse a bcm socket
* socketcan tasks now reuse a bcm socket #404, #425, #426,
* socketcan bugfix to receive error frames #384

vector
Expand Down
2 changes: 1 addition & 1 deletion can/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import logging

__version__ = "3.0.0-dev"
__version__ = "3.0.0"

log = logging.getLogger('can')

Expand Down
6 changes: 3 additions & 3 deletions can/io/asc.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ASCWriter(BaseIOHandler, Listener):

FORMAT_MESSAGE = "{channel} {id:<15} Rx {dtype} {data}"
FORMAT_DATE = "%a %b %m %I:%M:%S %p %Y"
FORMAT_EVENT = "{timestamp: 9.4f} {message}\n"
FORMAT_EVENT = "{timestamp: 9.6f} {message}\n"

def __init__(self, file, channel=1):
"""
Expand Down Expand Up @@ -181,8 +181,8 @@ def log_event(self, message, timestamp=None):
self.header_written = True
self.log_event("Start of measurement") # caution: this is a recursive call!

# figure out the correct timestamp
if timestamp is None or timestamp < self.last_timestamp:
# Use last known timestamp if unknown
if timestamp is None:
timestamp = self.last_timestamp

# turn into relative timestamps if necessary
Expand Down