py_projects/terminalUi/local.pytermtk.py
AlexVeeBee a5106b4c14 Commit
2024-01-22 12:57:10 +00:00

57 lines
1.6 KiB
Python

import argparse
import sys, os
import threading
import customlog as log
log.customPrint("Preparing", "INFO")
import TermTk as ttk
# Create a new application
def checkApps(root=None):
git = os.system("git --version")
if git != 0:
log.customPrint("Git is not installed", "ERROR")
raise Exception("Git is not installed")
node = os.system("node --version")
if node != 0:
log.customPrint("Node is not installed", "ERROR")
raise Exception("Node is not installed")
pass
# def drawMain(root=None, border=True):
# spliter = ttk.TTkLabel(parent=root, text="Getting Ready", border=border)
# root.layout().addWidget(spliter)
def main():
log.customPrint("Starting PyTermTK", "INFO")
root = ttk.TTk(title="PyTermTK", layout=ttk.TTkGridLayout(), mouseTrack=True)
tab = ttk.TTkTabWidget(parent=root)
maintab = ttk.TTkTabWidget(parent=tab, title="Main")
maintab.layout().addWidget(ttk.TTkLabel(parent=maintab, text="Getting Ready", border=True))
quitButton = ttk.TTkButton(parent=maintab, text="Quit", layout=ttk.TTkGridLayout())
tab.addTab( maintab, "Main" )
quitButton.clicked.connect(ttk.TTkHelper.quit)
root.mainloop()
os.system('cls' if os.name == 'nt' else 'clear')
pass
if __name__ == "__main__":
try:
checkApps()
import time
time.sleep(1)
main()
exit(0)
except Exception as e:
import traceback
log.customPrint("Unexpected error", "ERROR")
print("Error: ")
print()
traceback.print_exc()
exit(1)