-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.py
More file actions
52 lines (41 loc) · 1.88 KB
/
startup.py
File metadata and controls
52 lines (41 loc) · 1.88 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from rich.console import Console
from rich.table import Table
from rich.markdown import Markdown
from colors import TEXT_COLORS
from commands import Commands
from dotenv import load_dotenv
load_dotenv(dotenv_path="./env")
console = Console()
class OnStartup:
def description_display(self):
"""Display ASCII Refer text with about their description
"""
with open("./ascii.txt", 'r') as file:
ascii_text = file.read()
with open("./introduction.md", "r", encoding="utf-8") as mdfile:
about = Markdown(mdfile.read())
print(f"{TEXT_COLORS.YELLOW}{ascii_text}{TEXT_COLORS.RESET}\n")
console.print(about)
print("\n")
def commands_display(self):
"""Display all commands in category wise tables
"""
# basic commands
basic_commands = Table(title="BASIC COMMANDS", show_lines=True)
basic_commands.add_column("command")
basic_commands.add_column("for")
for command, forr in Commands.BASIC_COMMANDS.items():
basic_commands.add_row(f"[bold cyan]{command}[/bold cyan]", forr)
console.print(basic_commands)
# ----------------------------------------------------
# Referral commands
# ----------------------------------------------------
referral_from_local_commands = Table(
title="COMMANDS FOR REFERRAL THROUGH LOCAL PATHS", show_lines=True, border_style="yellow")
referral_from_local_commands.add_column("command")
referral_from_local_commands.add_column("for")
referral_from_local_commands.add_column("example")
for command, detail in Commands.REFERRAL_FROM_LOCAL.items():
referral_from_local_commands.add_row(f"[bold cyan]{command}[/bold cyan]", detail.get(
'for'), detail.get('example'))
console.print(referral_from_local_commands)