Example #1
0
    def run(self):
        env = self.state.document.settings.env

        targetid = f"screenshot-{env.new_serialno('screenshot')}"
        targetnode = nodes.target("", "", ids=[targetid])

        image_name = f"_{targetid}"
        try:
            content = ast.literal_eval("\n".join(self.content))
        except:  # noqa e722
            content = {
                "color": "#990000",
                "background": "#FFFF00",
                "full_text": " IMAGE DATA ERROR ",
            }

        process(image_name, content, False)
        image_path = Path("screenshots") / (image_name + ".png")
        screenshot_node = nodes.image(uri=image_path)
        return [targetnode, screenshot_node]
Example #2
0
    def run(self):
        env = self.state.document.settings.env

        targetid = "screenshot-%d" % env.new_serialno('screenshot')
        targetnode = nodes.target('', '', ids=[targetid])

        image_name = '_%s' % targetid
        try:
            content = ast.literal_eval('\n'.join(self.content))
        except:  # noqa e722
            content = {
                'color': '#990000',
                'background': '#FFFF00',
                'full_text': ' IMAGE DATA ERROR ',
            }

        process(image_name, content, False)
        image_path = os.path.join('screenshots', image_name + '.png')
        screenshot_node = nodes.image(uri=image_path)
        return [targetnode, screenshot_node]
Example #3
0
    def run(self):
        env = self.state.document.settings.env

        targetid = "screenshot-%d" % env.new_serialno("screenshot")
        targetnode = nodes.target("", "", ids=[targetid])

        image_name = "_%s" % targetid
        try:
            content = ast.literal_eval("\n".join(self.content))
        except:  # noqa e722
            content = {
                "color": "#990000",
                "background": "#FFFF00",
                "full_text": " IMAGE DATA ERROR ",
            }

        process(image_name, content, False)
        image_path = os.path.join("screenshots", image_name + ".png")
        screenshot_node = nodes.image(uri=image_path)
        return [targetnode, screenshot_node]
Example #4
0
    def run(self):
        env = self.state.document.settings.env

        targetid = "screenshot-%d" % env.new_serialno('screenshot')
        targetnode = nodes.target('', '', ids=[targetid])

        image_name = '_%s' % targetid
        try:
            content = ast.literal_eval('\n'.join(self.content))
        except:  # noqa e722
            content = {
                'color': '#990000',
                'background': '#FFFF00',
                'full_text': ' IMAGE DATA ERROR ',
            }

        process(image_name, content, False)
        image_path = os.path.join('screenshots', image_name + '.png')
        screenshot_node = nodes.image(uri=image_path)
        return [targetnode, screenshot_node]