Пример #1
0
 def warning(self, message):
     """
     Add the message if the level is warning or less.
     """
     LEVEL_NUMBER = 2
     PREPEND(2)
     self._write(message, LEVEL_NUMBER)
Пример #2
0
 def info(self, message):
     """
     Add the message if the level is info or less.
     """
     LEVEL_NUMBER = 1
     PREPEND(1)
     self._write(message, LEVEL_NUMBER)
Пример #3
0
 def debug(self, message):
     """
     Add the message if the level is debug.
     """
     LEVEL_NUMBER = 0
     PREPEND(1)
     self._write(message, LEVEL_NUMBER)
Пример #4
0
 def error(self, message):
     """
     Add the message if the level is error or less.
     """
     LEVEL_NUMBER = 3
     PREPEND(2)
     self._write(message, LEVEL_NUMBER)
Пример #5
0
 def critical(self, message):
     """
     Add the message if the level is critical or less.
     """
     LEVEL_NUMBER = 4
     PREPEND(2)
     self._write(message, LEVEL_NUMBER)
     exit()
Пример #6
0
def main(SONG_NAME=''):
    """Run on program call."""
    cache = Cache()
    match = cache.search(SONG_NAME)
    if match:
        PREPEND(1)
        print(Fore.MAGENTA, end='')
        print('{} '.format(SONG_NAME), end='')
        print(Style.RESET_ALL, end='')
        print('found.')
        while True:
            choice = input('Do you still want to continue[y/n]')
            choice = choice.lower()
            if choice == 'y' or choice == 'Y':
                return True
            elif choice == 'n' or choice == 'N':
                return False
    else:
        return True