-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpypc.py
75 lines (62 loc) · 2.51 KB
/
pypc.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
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import argparse
import logging
from rich.console import Console
from rich import print
from rich import pretty
from generate import *
console = Console()
FORMAT = '%(levelname)s %(asctime)s %(filename)s %(lineno)d %(message)s'
logging.basicConfig(
filename='pypc.log', encoding='utf-8', level=logging.DEBUG, format=FORMAT, datefmt="[%X]",
)
# Basic logging test
# logging.info("Does this work?")
def banner():
print(r'''
______ ______ _____ +----------------------+
| ___ \ | ___ \/ __ \ | Created by <art3m1s> |
| |_/ / _| |_/ /| / \/ +----------------------+
| __/ | | | __/ | | | Version: 0.1#dev |
| | | |_| | | | \__/\ +----------------------+
\_| \__, \_| \____/
__/ |
|___/ ''')
def info():
print('''\n◇ Info:
Python Package Creator (PyPC) is a simple tool to easily generate
standardized project files. It includes several basic configurations,
that can be setup with a click, or you can set up custom configurations.''')
def menu():
while 1:
banner()
print("\n[bold white][[/bold white][green bold]1[/green bold][bold white]][/bold white] [cyan]Generate a new project[/cyan]")
print("[bold white][[/bold white][green bold]2[/green bold][bold white]][/bold white] [cyan]Create a custom template[/cyan]")
print("\n[bold white][[/bold white][green bold]3[/green bold][bold white]][/bold white] [cyan]Info[/cyan]")
print("[bold white][[/bold white][green bold]4[/green bold][bold white]][/bold white] [cyan]LICENSE[/cyan]")
print("[bold white][[/bold white][green bold]5[/green bold][bold white]][/bold white] [cyan]Exit[/cyan]")
while 1:
try:
ID = int(console.input("\n[bold white][[/bold white][bold yellow]+[/bold yellow][bold white]][/bold white] [cyan]Enter mode ID: [/cyan]"))
break
except ValueError:
print("[bold white][[/bold white][red bold]![/red bold][bold white]][/bold white] [green]Invalid ID (input must be an integer)[/green]")
if ID == 1:
generate()
break
elif ID == 2:
create()
break
elif ID == 3:
info()
break
elif ID == 4:
license()
break
elif ID == 5:
quit()
else:
print("[bold white][[/bold white][red bold]![/red bold][bold white]][/bold white] [green]Invalid ID (input must be an integer)[/green]")
def main():
menu()
if __name__ == '__main__':
main()