Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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
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