|
5 | 5 | - https://bitbucket.org/tobylorenz/vector_asc/src/47556e1a6d32c859224ca62d075e1efcc67fa690/src/Vector/ASC/tests/unittests/data/CAN_Log_Trigger_3_2.asc?at=master&fileviewer=file-view-default
|
6 | 6 | - under `test/data/logfile.asc`
|
7 | 7 | """
|
8 |
| -import gzip |
9 | 8 | import re
|
10 | 9 | from typing import Any, Generator, List, Optional, Dict, Union, TextIO
|
11 | 10 |
|
@@ -405,69 +404,3 @@ def on_message_received(self, msg: Message) -> None:
|
405 | 404 | data=" ".join(data),
|
406 | 405 | )
|
407 | 406 | self.log_event(serialized, msg.timestamp)
|
408 |
| - |
409 |
| - |
410 |
| -class GzipASCReader(ASCReader): |
411 |
| - """Gzipped version of :class:`~can.ASCReader`""" |
412 |
| - |
413 |
| - def __init__( |
414 |
| - self, |
415 |
| - file: Union[typechecking.FileLike, typechecking.StringPathLike], |
416 |
| - base: str = "hex", |
417 |
| - relative_timestamp: bool = True, |
418 |
| - ): |
419 |
| - """ |
420 |
| - :param file: a path-like object or as file-like object to read from |
421 |
| - If this is a file-like object, is has to opened in text |
422 |
| - read mode, not binary read mode. |
423 |
| - :param base: Select the base(hex or dec) of id and data. |
424 |
| - If the header of the asc file contains base information, |
425 |
| - this value will be overwritten. Default "hex". |
426 |
| - :param relative_timestamp: Select whether the timestamps are |
427 |
| - `relative` (starting at 0.0) or `absolute` (starting at |
428 |
| - the system time). Default `True = relative`. |
429 |
| - """ |
430 |
| - self._fileobj = None |
431 |
| - if file is not None and (hasattr(file, "read") and hasattr(file, "write")): |
432 |
| - # file is None or some file-like object |
433 |
| - self._fileobj = file |
434 |
| - super(GzipASCReader, self).__init__( |
435 |
| - gzip.open(file, mode="rt"), base, relative_timestamp |
436 |
| - ) |
437 |
| - |
438 |
| - def stop(self) -> None: |
439 |
| - super(GzipASCReader, self).stop() |
440 |
| - if self._fileobj is not None: |
441 |
| - self._fileobj.close() |
442 |
| - |
443 |
| - |
444 |
| -class GzipASCWriter(ASCWriter): |
445 |
| - """Gzipped version of :class:`~can.ASCWriter`""" |
446 |
| - |
447 |
| - def __init__( |
448 |
| - self, |
449 |
| - file: Union[typechecking.FileLike, typechecking.StringPathLike], |
450 |
| - channel: int = 1, |
451 |
| - compresslevel: int = 6, |
452 |
| - ): |
453 |
| - """ |
454 |
| - :param file: a path-like object or as file-like object to write to |
455 |
| - If this is a file-like object, is has to opened in text |
456 |
| - write mode, not binary write mode. |
457 |
| - :param channel: a default channel to use when the message does not |
458 |
| - have a channel set |
459 |
| - :param compresslevel: Gzip compresslevel, see |
460 |
| - :class:`~gzip.GzipFile` for details. The default is 6. |
461 |
| - """ |
462 |
| - self._fileobj = None |
463 |
| - if file is not None and (hasattr(file, "read") and hasattr(file, "write")): |
464 |
| - # file is None or some file-like object |
465 |
| - self._fileobj = file |
466 |
| - super(GzipASCWriter, self).__init__( |
467 |
| - gzip.open(file, mode="wt", compresslevel=compresslevel), channel |
468 |
| - ) |
469 |
| - |
470 |
| - def stop(self) -> None: |
471 |
| - super(GzipASCWriter, self).stop() |
472 |
| - if self._fileobj is not None: |
473 |
| - self._fileobj.close() |
0 commit comments