2020-11-26 16:20:02 +01:00
|
|
|
# THIS FILE IS A PART OF VCStudio
|
|
|
|
# PYTHON 3
|
|
|
|
import sys
|
2021-01-03 00:37:40 +01:00
|
|
|
import subprocess
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
# This is our main file. And untill now there was no love given to it. So I
|
|
|
|
# will attemt to polish this file quite a bit. Because the code I see now is
|
|
|
|
# just ugly. Anyway here we go.
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
# We probably need the following modules.
|
2020-11-26 16:20:02 +01:00
|
|
|
from settings import settings
|
|
|
|
from settings import talk
|
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
# Before we launch anything let's troubleshoot the bastard
|
|
|
|
if not settings.read("VCStudio-is-good")\
|
|
|
|
or not settings.read("Python-is-good")\
|
|
|
|
or not settings.read("Language"):
|
|
|
|
from troubleshooter import troubleshooter
|
|
|
|
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
# It's quite a good thing to use extensions for the software using arguments
|
|
|
|
# in the terminal. Stuff like -c console mode. Or other. So let's work on this
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
if len(sys.argv) > 1:
|
|
|
|
command = sys.argv[1]
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
# So here I gonna have the command so to speak.
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
if command == "-t":
|
|
|
|
# Trouble shooter. Why not.
|
|
|
|
from troubleshooter import troubleshooter
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
elif command == "-c":
|
|
|
|
# Console mode. Why not.
|
2020-11-26 16:20:02 +01:00
|
|
|
from project_manager import pm_console
|
|
|
|
pm_console.run()
|
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
elif command == "-ms":
|
|
|
|
|
|
|
|
# This one is a bit harder. Because we need a project name.
|
|
|
|
if len(sys.argv) > 2:
|
|
|
|
projectname = sys.argv[2]
|
|
|
|
else:
|
|
|
|
projectname = input("Project Name: ")
|
|
|
|
|
|
|
|
# Then will launch it.
|
|
|
|
subprocess.Popen(["python3", "network/multiuser_server.py", projectname])
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
elif command == "-rm":
|
|
|
|
# The read messages terminal app.
|
|
|
|
from network import read_messages
|
2020-11-26 16:20:02 +01:00
|
|
|
|
2021-01-03 00:37:40 +01:00
|
|
|
elif command == "-sm":
|
|
|
|
# The read messages terminal app.
|
|
|
|
from network import send_messages
|
|
|
|
|
|
|
|
elif command == "-tc":
|
|
|
|
# The read messages terminal app.
|
|
|
|
from network import test_client
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# Well technically if they type --help or any other thing
|
|
|
|
# it should give them a help page, right?
|
|
|
|
|
|
|
|
print("VCStudio help page. For those of you, nerdy people.")
|
|
|
|
print()
|
|
|
|
print(" --help Gives you this help page. I know obvious.")
|
|
|
|
print(" -c Console mode. Not all functions available.")
|
|
|
|
print(" -t Troubleshooter. Run Troubleshooter.")
|
|
|
|
print(" -ms Multiuser Server in terminal.")
|
|
|
|
print(" -tc Test Multiuser Client.")
|
|
|
|
print(" -rm Test Broadcast Reader.")
|
|
|
|
print(" -sm Test Broadcast Writer.")
|
|
|
|
print()
|
|
|
|
print()
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
from project_manager import pm_gtk
|
|
|
|
pm_gtk.run()
|
|
|
|
|
|
|
|
# Yeah. Now it looks better.
|