Split lib.py into util Package

This commit is contained in:
koumakpet 2020-04-03 22:07:09 +02:00
parent 08c0933b27
commit aaadf596ba
10 changed files with 579 additions and 548 deletions

65
util/Print.py Normal file
View file

@ -0,0 +1,65 @@
#!/bin/python3
from util import Color
def question(question):
'''Print syntax for question
Arguments:
question {str} -- text to print (question)
'''
print(f'{Color.GREEN} // {question}{Color.RESET}')
def question_options(options):
'''Print syntax for options for question
Arguments:
options {str} -- options to print
'''
print(f'{Color.GREEN} # {options}{Color.RESET}')
def action(action):
'''Print syntax for actions
Arguments:
action {str} -- text to print
'''
print(f'{Color.GOLD} >> {action}{Color.RESET}')
def err(text):
'''Print syntax for error
Arguments:
text {str} -- error text to print
'''
print(f'{Color.RED} !! {text}{Color.RESET}')
def cancel(text):
'''Print syntax for cancellation
Arguments:
text {str} -- text to print
'''
print(f'{Color.GREY} >> {text}{Color.RESET}')
def comment(text):
'''Print syntax for comments
Arguments:
text {str} -- text to print
'''
print(f'{Color.GREY} // {text}{Color.RESET}')
def warning(text):
'''Print syntax for warnings
Arguments:
text {str} -- warn text to print
'''
print(f'{Color.YELLOW} ** {text}{Color.RESET}')