Beispiel #1
0
    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]
Beispiel #2
0
 def spinner_failure(self, spinner):
     if Console.supports_emojis():
         spinner.red.fail("✘")
     else:
         spinner.red.fail("Failed")
Beispiel #3
0
 def spinner_success(self, spinner):
     if Console.supports_emojis():
         spinner.green.ok("✔")
     else:
         spinner.green.ok("Success")