Skip to content

Commit 9be137a

Browse files
Fix canplayer script
Fixes hardbyte#145
1 parent bffc95b commit 9be137a

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

can/interfaces/virtual.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
logger = logging.getLogger(__name__)
22-
logger.setLevel(logging.DEBUG)
22+
#logger.setLevel(logging.DEBUG)
2323

2424

2525
# Channels are lists of queues, one for each connection

can/io/player.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
"""
88
from __future__ import print_function
99
import datetime
10+
import time
1011
import argparse
12+
import logging
1113

1214
import can
1315
from .blf import BLFReader
1416
from .sqlite import SqlReader
1517

18+
log = logging.getLogger('can.io.player')
19+
1620

1721
class LogReader(object):
1822
"""
@@ -101,7 +105,7 @@ def main():
101105
parser.add_argument('-i', '--interface', dest="interface",
102106
help='''Specify the backend CAN interface to use. If left blank,
103107
fall back to reading from configuration files.''',
104-
choices=can.interface.VALID_INTERFACES)
108+
choices=can.VALID_INTERFACES)
105109

106110
parser.add_argument('-b', '--bitrate', type=int,
107111
help='''Bitrate to use for the CAN bus.''')
@@ -115,7 +119,7 @@ def main():
115119
help='''<s> skip gaps greater than 's' seconds''')
116120

117121
parser.add_argument('infile', metavar='input-file', type=str,
118-
help='The file to replay. Supported types: .db')
122+
help='The file to replay. Supported types: .db, .blf')
119123

120124
results = parser.parse_args()
121125

@@ -141,6 +145,8 @@ def main():
141145

142146
try:
143147
for m in in_sync:
148+
if verbosity >= 3:
149+
print(m)
144150
bus.send(m)
145151
except KeyboardInterrupt:
146152
pass

0 commit comments

Comments
 (0)