-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
59 lines (49 loc) · 2.98 KB
/
main.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
import argparse
import subprocess
import sys, os
from colorama import init, Fore, Style
from interactive_cli import interactive_loop
# Initialize colorama
init(autoreset=True)
def resource_path(relative_path):
""" Get the absolute path to a resource, works for PyInstaller """
if getattr(sys, '_MEIPASS', False): # If running in a PyInstaller bundle
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath("."), relative_path)
def launch_gui():
from src.gui.gui_handler import App
app = App()
app.mainloop()
def print_ascii_banner():
banner = """
{}
::
%%
%%
#*:*##%#+. -*###%#= -*%###+:%% .=#####+: .+#%%%#+: =*%%%%#+. .=*%%%%#=. *#+=#%%%#=. :+#%%%#+:
%%#. -%# #%- :#%. +%+ -%%% :%# *%- .%%%:.-**= .%%%#)%%%. -%%% %%%: #%%%*==*%%%: =%%# *%%=
%% #% *%- .%# :%+ .%% %%=::::::%% #%%+-:. *%%: .%%%: .%%# #%%. :%%% :%%%=====#%%
%# *% %%. #% =%- %% .%%========= -+*#%%%+ #%% .%%# *%% #%* #%%.-%%.
%# *% =%+ -%+ .%# =%% *%- -. .-+: +%%- =%%+. =+-. #%%+. .=%%* #%%= .+%%* %%%: ==.
%# *% :##=--=#%= :#%+--=#*%% =%*=--+%#: .*%%%##%%* =#%%%%%%%+ +%%%%%%%%= #%%#%%%%%%= .*%%%#%%%#:
-- :- :-===: .===-. -- :===-. .-===-. :-===- :====: #%# :===- -===-.
#%#
#%#
Nodescope: an XML Editor and Visualizer
{}""".format(Fore.CYAN, Style.RESET_ALL)
print(banner)
def launch_cli():
interactive_loop()
def main():
parser = argparse.ArgumentParser(description="nodescope: an XML Editor and Visualizer")
parser.add_argument("--gui", action="store_true", help="Launch GUI interface")
parser.add_argument("--cli", action="store_true", help="Launch CLI interface")
args = parser.parse_args()
if args.gui:
launch_gui()
elif args.cli:
launch_cli()
else:
parser.print_help()
if __name__ == "__main__":
main()