How to use the asciinema.recorder.record function in asciinema

To help you get started, we’ve selected a few asciinema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asciinema / asciinema / asciinema / commands / record.py View on Github external
return 1

        if append:
            self.print_info("appending to asciicast at %s" % self.filename)
        else:
            self.print_info("recording asciicast to %s" % self.filename)

        if self.command:
            self.print_info("""exit opened program when you're done""")
        else:
            self.print_info("""press  or type "exit" when you're done""")

        vars = filter(None, map((lambda var: var.strip()), self.env_whitelist.split(',')))

        try:
            recorder.record(
                self.filename,
                command=self.command,
                append=append,
                title=self.title,
                idle_time_limit=self.idle_time_limit,
                command_env=self.env,
                capture_env=vars,
                rec_stdin=self.rec_stdin,
                writer=self.writer
            )
        except v2.LoadError:
            self.print_error("can only append to asciicast v2 format recordings")
            return 1

        self.print_info("recording finished")
github asciinema / asciinema / asciinema / __init__.py View on Github external
def record_asciicast(path, command=None, append=False, idle_time_limit=None,
                     rec_stdin=False, title=None, metadata=None,
                     command_env=None, capture_env=None):
    asciinema.recorder.record(
        path,
        command=command,
        append=append,
        idle_time_limit=idle_time_limit,
        rec_stdin=rec_stdin,
        title=title,
        metadata=metadata,
        command_env=command_env,
        capture_env=capture_env
    )