|
7 | 7 |
|
8 | 8 | import dataclasses
|
9 | 9 | import re
|
10 |
| -from typing import Generator |
| 10 | +from typing import Any, Generator |
11 | 11 | from pathlib import Path
|
12 | 12 |
|
13 | 13 | from .progress_stats import ProgressStats
|
@@ -60,8 +60,8 @@ def printAsCsv(self):
|
60 | 60 | print(f"{self.name},{self.vram:08X},{self.size}")
|
61 | 61 |
|
62 | 62 |
|
63 |
| - def toJson(self) -> dict: |
64 |
| - result = { |
| 63 | + def toJson(self) -> dict[str, Any]: |
| 64 | + result: dict[str, Any] = { |
65 | 65 | "name": self.name,
|
66 | 66 | "vram": self.getVramStr(),
|
67 | 67 | "size": self.serializeSize(),
|
@@ -178,8 +178,8 @@ def printAsCsv(self, printVram: bool=True):
|
178 | 178 | print(f"{self.filepath},{self.segmentType},{symCount},{maxSize},{self.size},{averageSize:0.2f}")
|
179 | 179 |
|
180 | 180 |
|
181 |
| - def toJson(self) -> dict: |
182 |
| - fileDict = { |
| 181 | + def toJson(self) -> dict[str, Any]: |
| 182 | + fileDict: dict[str, Any] = { |
183 | 183 | "filepath": str(self.filepath),
|
184 | 184 | "segmentType": self.segmentType,
|
185 | 185 | "vram": self.serializeVram(),
|
@@ -524,13 +524,13 @@ def printSymbolsCsv(self):
|
524 | 524 | return
|
525 | 525 |
|
526 | 526 |
|
527 |
| - def toJson(self) -> dict: |
| 527 | + def toJson(self) -> dict[str, Any]: |
528 | 528 | filesList = []
|
529 | 529 |
|
530 | 530 | for file in self.filesList:
|
531 | 531 | filesList.append(file.toJson())
|
532 | 532 |
|
533 |
| - result = { |
| 533 | + result: dict[str, Any] = { |
534 | 534 | "files": filesList
|
535 | 535 | }
|
536 | 536 | return result
|
|
0 commit comments