def process(name, path, data, module=True):
<EOL>try:<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>global font, glyph_data<EOL>if font is None:<EOL><INDENT>font = ImageFont.truetype(FONT, FONT_SIZE * SCALE)<EOL><DEDENT>if glyph_data is None:<EOL><INDENT>glyph_data = TTFont(font.path)<EOL><DEDENT>if not isinstance(data, list):<EOL><INDENT>data = [data]<EOL><DEDENT>if contains_bad_glyph(glyph_data, data):<EOL><INDENT>print("<STR_LIT>" % (name, font.getname()[<NUM_LIT:0>]))<EOL><DEDENT>else:<EOL><INDENT>create_screenshot(name, data, path, font=font, is_module=module)<EOL><DEDENT>
Process data to create a screenshot which will be saved in
docs/screenshots/<name>.png
If module is True the screenshot will include the name and py3status.