Skip to content

Commit 3f1a1b9

Browse files
author
sheepzh
committed
Fix bug
1 parent 333ebda commit 3f1a1b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

script/user_count.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import math
99

1010
svg_file_path = os.path.join('output', 'user_count.svg')
11-
11+
output_dir_path = 'output'
1212

1313
def smooth_count(last_value, step_num, current_value, data):
1414
unit_val = (current_value-last_value) / (step_num+1)
@@ -91,6 +91,8 @@ def render():
9191
chart.add('Chrome', chrome_data)
9292
chart.add('Edge', edge_data)
9393
svg = chart.render()
94+
if not os.path.exists(output_dir_path):
95+
os.makedirs(output_dir_path)
9496
with open(svg_file_path, 'wb') as svg_file:
9597
svg_file.write(svg)
9698
cairosvg.svg2svg(file_obj=open(svg_file_path, 'r'), write_to=svg_file_path)

0 commit comments

Comments
 (0)