File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55Interfaces contain low level implementations that interact with CAN hardware.
66"""
77
8+ import logging
9+
810from pkg_resources import iter_entry_points
911
12+ logger = logging .getLogger (__name__ )
13+
1014# interface_name => (module, classname)
1115BACKENDS = {
1216 'kvaser' : ('can.interfaces.kvaser' , 'KvaserBus' ),
2832 for interface in iter_entry_points ('can.interface' )
2933})
3034
35+ # Old entry point name. May be removed in 3.0.
36+ for interface in iter_entry_points ('python_can.interface' ):
37+ BACKENDS [interface .name ] = (interface .module_name , interface .attrs [0 ])
38+ logger .warning ('%s is using the deprecated python_can.interface entry point. '
39+ 'Please change to can.interface instead.' , interface .name )
40+
3141VALID_INTERFACES = frozenset (list (BACKENDS .keys ()) + ['socketcan_native' , 'socketcan_ctypes' ])
Original file line number Diff line number Diff line change @@ -25,15 +25,15 @@ The available interfaces are:
2525 interfaces/virtual
2626
2727Additional interfaces can be added via a plugin interface. An external package
28- can register a new interface by using the ``python_can .interface `` entry point.
28+ can register a new interface by using the ``can .interface `` entry point in its setup.py .
2929
3030The format of the entry point is ``interface_name=module:classname `` where
31- ``classname `` is a :class: `can.BusABC ` concrete implementation.
31+ ``classname `` is a concrete :class: `can.BusABC ` implementation.
3232
3333::
3434
3535 entry_points={
36- 'python_can .interface': [
36+ 'can .interface': [
3737 "interface_name=module:classname",
3838 ]
3939 },
You can’t perform that action at this time.
0 commit comments