How to use the asciinema.asciicast 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 timhsutw / honeyterm / honeyterm_asciinema / asciinema / asciinema / commands / play.py View on Github external
def execute(self):
        try:
            self.player.play(asciicast.load(self.filename), self.max_wait, self.speed)

        except asciicast.LoadError as e:
            self.print_warning("Playback failed: %s" % str(e))
            return 1
        except KeyboardInterrupt:
            return 1

        return 0
github asciinema / asciinema / asciinema / commands / play.py View on Github external
def execute(self):
        try:
            with asciicast.open_from_url(self.filename) as a:
                self.player.play(a, self.idle_time_limit, self.speed)

        except asciicast.LoadError as e:
            self.print_error("playback failed: %s" % str(e))
            return 1
        except KeyboardInterrupt:
            return 1

        return 0
github asciinema / asciinema / asciinema / commands / cat.py View on Github external
def execute(self):
        try:
            with asciicast.open_from_url(self.filename) as a:
                for t, _type, text in a.stdout_events():
                    sys.stdout.write(text)
                    sys.stdout.flush()

        except asciicast.LoadError as e:
            self.print_error("printing failed: %s" % str(e))
            return 1

        return 0
github timhsutw / honeyterm / honeyterm_asciinema / asciinema / asciinema / commands / play.py View on Github external
def execute(self):
        try:
            self.player.play(asciicast.load(self.filename), self.max_wait, self.speed)

        except asciicast.LoadError as e:
            self.print_warning("Playback failed: %s" % str(e))
            return 1
        except KeyboardInterrupt:
            return 1

        return 0