Raw (binary) data representing parsed, but not deserialized file.
| 351 | |
| 352 | |
| 353 | class FileRawData: |
| 354 | """Raw (binary) data representing parsed, but not deserialized file.""" |
| 355 | |
| 356 | __slots__ = ( |
| 357 | "defs", |
| 358 | "imports", |
| 359 | "raw_errors", |
| 360 | "ignored_lines", |
| 361 | "is_partial_stub_package", |
| 362 | "uses_template_strings", |
| 363 | "source_hash", |
| 364 | "mypy_comments", |
| 365 | ) |
| 366 | |
| 367 | defs: bytes |
| 368 | imports: bytes |
| 369 | raw_errors: list[ParseError] |
| 370 | ignored_lines: dict[int, list[str]] |
| 371 | is_partial_stub_package: bool |
| 372 | uses_template_strings: bool |
| 373 | source_hash: str |
| 374 | mypy_comments: list[tuple[int, str]] |
| 375 | |
| 376 | def __init__( |
| 377 | self, |
| 378 | defs: bytes, |
| 379 | imports: bytes, |
| 380 | raw_errors: list[ParseError], |
| 381 | ignored_lines: dict[int, list[str]], |
| 382 | is_partial_stub_package: bool, |
| 383 | uses_template_strings: bool, |
| 384 | source_hash: str = "", |
| 385 | mypy_comments: list[tuple[int, str]] | None = None, |
| 386 | ) -> None: |
| 387 | self.defs = defs |
| 388 | self.imports = imports |
| 389 | self.raw_errors = raw_errors |
| 390 | self.ignored_lines = ignored_lines |
| 391 | self.is_partial_stub_package = is_partial_stub_package |
| 392 | self.uses_template_strings = uses_template_strings |
| 393 | self.source_hash = source_hash |
| 394 | self.mypy_comments = mypy_comments if mypy_comments is not None else [] |
| 395 | |
| 396 | def write(self, data: WriteBuffer) -> None: |
| 397 | write_bytes(data, self.defs) |
| 398 | write_bytes(data, self.imports) |
| 399 | write_tag(data, LIST_GEN) |
| 400 | write_int_bare(data, len(self.raw_errors)) |
| 401 | for err in self.raw_errors: |
| 402 | write_parse_error(data, err) |
| 403 | write_tag(data, DICT_INT_GEN) |
| 404 | write_int_bare(data, len(self.ignored_lines)) |
| 405 | for line, codes in self.ignored_lines.items(): |
| 406 | write_int(data, line) |
| 407 | write_str_list(data, codes) |
| 408 | write_bool(data, self.is_partial_stub_package) |
| 409 | write_bool(data, self.uses_template_strings) |
| 410 | write_str(data, self.source_hash) |
no outgoing calls
no test coverage detected
searching dependent graphs…