Skip to content

Commit e2b31f9

Browse files
committed
Add method of injecting debug to old api
1 parent 70d4368 commit e2b31f9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/py/kaleido/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import base64
55
import json
66
import sys
7+
import os
78

89
import async_timeout as atimeout
910

@@ -39,7 +40,9 @@ def get_image():
3940
pass
4041
return asyncio.run(to_image(spec, f, topojson, mapbox_token, debug=debug))
4142

42-
async def to_image(spec, f=None, topojson=None, mapbox_token=None, debug=False, timeout=60):
43+
async def to_image(spec, f=None, topojson=None, mapbox_token=None, debug=None, timeout=60):
44+
if debug is None:
45+
debug = "KALEIDO-DEBUG" in os.environ
4346
def check_error(res):
4447
if 'error' in res:
4548
raise RuntimeError(str(res))

0 commit comments

Comments
 (0)