Skip to content

Commit fff302e

Browse files
committed
Fix typing in _mocker.
1 parent c39d784 commit fff302e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/py/kaleido/_mocker.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pathlib import Path
1010
from pprint import pp
1111
from random import sample
12+
from typing import TypedDict
1213

1314
import logistro
1415
import orjson
@@ -39,8 +40,14 @@ def _get_jsons_in_paths(path: str | Path) -> list[Path]:
3940
raise TypeError("--input must be file or directory")
4041

4142

43+
class Param(TypedDict):
44+
name: str
45+
opts: dict[str, int | float]
46+
47+
4248
def _load_figures_from_paths(paths: list[Path]):
4349
# Set json
50+
params: list[Param]
4451
for path in paths:
4552
if path.is_file():
4653
with path.open(encoding="utf-8") as file:
@@ -80,7 +87,10 @@ def _load_figures_from_paths(paths: list[Path]):
8087
for f in formats:
8188
params.append(
8289
{
83-
"name": f"{path.stem}-{w}x{h}X{s}.{f}",
90+
"name": (
91+
f"{path.stem!s}-{w!s}"
92+
f"x{h!s}X{s!s}.{f!s}"
93+
),
8494
"opts": {
8595
"scale": s,
8696
"width": w,

0 commit comments

Comments
 (0)