def get_frames(self, width: int = 80): """Return the frames used to animate a spinner in a console of specified width This returns the list of frames plus the timeout between the list """ if width in self.frames: return self.frames[width] frames = [] frames.append("") if Console.supports_emojis(): bar = "π π π π· π· π· π π π π π π π " else: bar = "-> -> -> #WearAMask :-) :-) :-) " for i in range(1, len(bar), 1): frames.append(bar[0:i]) self.frames[width] = (frames, 50) return self.frames[width]
def spinner_failure(self, spinner): if Console.supports_emojis(): spinner.red.fail("β") else: spinner.red.fail("Failed")
def spinner_success(self, spinner): if Console.supports_emojis(): spinner.green.ok("β") else: spinner.green.ok("Success")