@@ -302,7 +302,7 @@ class KvaserBus(BusABC):
302302 The CAN Bus implemented for the Kvaser interface.
303303 """
304304
305- def __init__ (self , channel , can_filters = None , ** config ):
305+ def __init__ (self , channel , can_filters = None , ** kwargs ):
306306 """
307307 :param int channel:
308308 The Channel id to create this bus with.
@@ -353,18 +353,18 @@ def __init__(self, channel, can_filters=None, **config):
353353 """
354354
355355 log .info ("CAN Filters: {}" .format (can_filters ))
356- log .info ("Got configuration of: {}" .format (config ))
357- bitrate = config .get ('bitrate' , 500000 )
358- tseg1 = config .get ('tseg1' , 0 )
359- tseg2 = config .get ('tseg2' , 0 )
360- sjw = config .get ('sjw' , 0 )
361- no_samp = config .get ('no_samp' , 0 )
362- driver_mode = config .get ('driver_mode' , DRIVER_MODE_NORMAL )
363- single_handle = config .get ('single_handle' , False )
364- receive_own_messages = config .get ('receive_own_messages' , False )
365- accept_virtual = config .get ('accept_virtual' , True )
366- fd = config .get ('fd' , False )
367- data_bitrate = config .get ('data_bitrate' , None )
356+ log .info ("Got configuration of: {}" .format (kwargs ))
357+ bitrate = kwargs .get ('bitrate' , 500000 )
358+ tseg1 = kwargs .get ('tseg1' , 0 )
359+ tseg2 = kwargs .get ('tseg2' , 0 )
360+ sjw = kwargs .get ('sjw' , 0 )
361+ no_samp = kwargs .get ('no_samp' , 0 )
362+ driver_mode = kwargs .get ('driver_mode' , DRIVER_MODE_NORMAL )
363+ single_handle = kwargs .get ('single_handle' , False )
364+ receive_own_messages = kwargs .get ('receive_own_messages' , False )
365+ accept_virtual = kwargs .get ('accept_virtual' , True )
366+ fd = kwargs .get ('fd' , False )
367+ data_bitrate = kwargs .get ('data_bitrate' , None )
368368
369369 try :
370370 channel = int (channel )
@@ -400,7 +400,7 @@ def __init__(self, channel, can_filters=None, **config):
400400 4 )
401401
402402 if fd :
403- if 'tseg1' not in config and bitrate in BITRATE_FD :
403+ if 'tseg1' not in kwargs and bitrate in BITRATE_FD :
404404 # Use predefined bitrate for arbitration
405405 bitrate = BITRATE_FD [bitrate ]
406406 if data_bitrate in BITRATE_FD :
@@ -411,7 +411,7 @@ def __init__(self, channel, can_filters=None, **config):
411411 data_bitrate = bitrate
412412 canSetBusParamsFd (self ._read_handle , data_bitrate , tseg1 , tseg2 , sjw )
413413 else :
414- if 'tseg1' not in config and bitrate in BITRATE_OBJS :
414+ if 'tseg1' not in kwargs and bitrate in BITRATE_OBJS :
415415 bitrate = BITRATE_OBJS [bitrate ]
416416 canSetBusParams (self ._read_handle , bitrate , tseg1 , tseg2 , sjw , no_samp , 0 )
417417
@@ -446,7 +446,7 @@ def __init__(self, channel, can_filters=None, **config):
446446 self ._timestamp_offset = time .time () - (timer .value * TIMESTAMP_FACTOR )
447447
448448 self ._is_filtered = False
449- super (KvaserBus , self ).__init__ (channel = channel , can_filters = can_filters , ** config )
449+ super (KvaserBus , self ).__init__ (channel = channel , can_filters = can_filters , ** kwargs )
450450
451451 def _apply_filters (self , filters ):
452452 if filters and len (filters ) == 1 :
0 commit comments