File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from pathlib import Path
1010from pprint import pp
1111from random import sample
12+ from typing import TypedDict
1213
1314import logistro
1415import 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+
4248def _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 ,
You can’t perform that action at this time.
0 commit comments