@@ -41,7 +41,10 @@ class VirtualBus(BusABC):
41
41
:meth:`can.VirtualBus._detect_available_configs` for how it
42
42
behaves here.
43
43
44
- The timeout when sending a message applies to each receiver.
44
+ .. note::
45
+ The timeout when sending a message applies to each receiver
46
+ individually. This means that sending can block up to 5 seconds
47
+ if a message is sent to 5 receivers with the timeout set to 1.0.
45
48
"""
46
49
47
50
def __init__ (self , channel = None , receive_own_messages = False ,
@@ -51,7 +54,7 @@ def __init__(self, channel=None, receive_own_messages=False,
51
54
52
55
# the channel identifier may be an arbitrary object
53
56
self .channel_id = channel
54
- self .channel_info = ' Virtual bus channel %s' % self .channel_id
57
+ self .channel_info = " Virtual bus channel {}" . format ( self .channel_id )
55
58
self .receive_own_messages = receive_own_messages
56
59
self ._open = True
57
60
@@ -71,7 +74,7 @@ def _check_if_open(self):
71
74
Has to be called in every method that accesses the bus.
72
75
"""
73
76
if not self ._open :
74
- raise CanError (' Operation on closed bus' )
77
+ raise CanError (" Operation on closed bus" )
75
78
76
79
def _recv_internal (self , timeout ):
77
80
self ._check_if_open ()
@@ -98,7 +101,7 @@ def send(self, msg, timeout=None):
98
101
except queue .Full :
99
102
all_sent = False
100
103
if not all_sent :
101
- raise CanError (' Could not send message to one or more recipients' )
104
+ raise CanError (" Could not send message to one or more recipients" )
102
105
103
106
def shutdown (self ):
104
107
self ._check_if_open ()
0 commit comments