Skip to content

Commit 890d218

Browse files
Reset types to allow stringy options
1 parent 2afbedb commit 890d218

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

schemascii/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
'nolabels': False,
1818
}
1919

20+
option_types = {
21+
'padding': float,
22+
'scale': float,
23+
'stroke_width': float,
24+
'stroke': str,
25+
'label': str,
26+
'nolabels': bool,
27+
}
28+
2029

2130
def render(filename: str, text: str = None, **options) -> str:
2231
"Render the Schemascii diagram to an SVG string."
@@ -25,6 +34,8 @@ def render(filename: str, text: str = None, **options) -> str:
2534
text = f.read()
2635
# default options
2736
options = default_options | options
37+
for oname, otypeufn in option_types.items():
38+
options[oname] = otypefun(option[oname])
2839
# get everything
2940
grid = Grid(filename, text)
3041
components, bom_data = find_all(grid)

0 commit comments

Comments
 (0)