-
Notifications
You must be signed in to change notification settings - Fork 2
/
utility.py
executable file
·27 lines (24 loc) · 1.5 KB
/
utility.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''Utility functions for Strapwn.'''
from os import system, name
from rich.console import Console
from logger import logger
def cls() -> None:
'''Clear the screen.'''
system('cls' if name=='nt' else 'clear')
def display_motd() -> None:
'''Display the MOTD.'''
console = Console()
cls()
console.print("""[bold magenta]
███████╗████████╗██████╗ █████╗ ██████╗ ██╗ ██╗███╗ ██╗
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗██║ ██║████╗ ██║
███████╗ ██║ ██████╔╝███████║██████╔╝██║ █╗ ██║██╔██╗ ██║
╚════██║ ██║ ██╔══██╗██╔══██║██╔═══╝ ██║███╗██║██║╚██╗██║
███████║ ██║ ██║ ██║██║ ██║██║ ╚███╔███╔╝██║ ╚████║
╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══╝╚══╝ ╚═╝ ╚═══╝
[/bold magenta][bold yellow]\n\tby @Shadawks[/bold yellow]
""", justify="center")
def clean_exit() -> None:
display_motd()
logger.info("Goodbye !")
exit(0)