Skip to content

Commit 77c8685

Browse files
committed
Open max_container_size in blf writer to API via kwargs
1 parent f7e4845 commit 77c8685

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

can/io/blf.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import datetime
1818
import time
1919
import logging
20-
from typing import List, BinaryIO, Generator, Union, Tuple, Optional, cast
20+
from typing import List, BinaryIO, Generator, Union, Tuple, Optional, cast, Any
2121

2222
from ..message import Message
2323
from ..util import len2dlc, dlc2len, channel2int
@@ -370,6 +370,8 @@ def __init__(
370370
append: bool = False,
371371
channel: int = 1,
372372
compression_level: int = -1,
373+
*args: Any,
374+
**kwargs: Any
373375
) -> None:
374376
"""
375377
:param file: a path-like object or as file-like object to write to
@@ -400,6 +402,9 @@ def __init__(
400402
self.compression_level = compression_level
401403
self._buffer: List[bytes] = []
402404
self._buffer_size = 0
405+
# If max container size is located in kwargs, then update the instance
406+
if kwargs.get("max_container_size", False):
407+
self.max_container_size = kwargs["max_container_size"]
403408
if append:
404409
# Parse file header
405410
data = self.file.read(FILE_HEADER_STRUCT.size)

0 commit comments

Comments
 (0)