1+ #Imported Variables
12import os
23import shutil
34import subprocess
45from sys import version_info
5-
66os .system ('color' )
7-
87# Pre-determined variables
98location = 0
109locationdir = os .getcwd ()
1312cmancode = subprocess .Popen (["python" , str (locationdir ) + "/bin/functions/registry/r~1.py" ])
1413subprogram = False
1514booted = False
16-
17- # Colors | For more help; see https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal
15+ # Colors
1816class bcolors :
1917 HEADER = '\033 [95m'
2018 OKBLUE = '\033 [94m'
@@ -25,17 +23,15 @@ class bcolors:
2523 ENDC = '\033 [0m'
2624 BOLD = '\033 [1m'
2725 UNDERLINE = '\033 [4m'
28-
29- # The error codes are in this dictionary for easy re-use; add new ones whenever you wish :)
26+ # Error Codes
3027error_codes = {
3128 "0x001" : "The 'bootloader' instance is already running." ,
3229 "0x002" : "The item you were searching for was not found." ,
3330 "0x003" : "The file cannot be executed." ,
3431 "0x004" : "The directory is not accessible." ,
3532 "0x005" : "That command doesn't exist. Type 'help' for a list of available commands."
3633}
37-
38- # Print error function for easy re-use; make sure to use the correct error code
34+ # Declaring Functions
3935def print_error (error_code , print_error = True ):
4036 try :
4137 error_message = f"{ bcolors .FAIL } Error code { error_code } : { error_codes [error_code ]} { bcolors .ENDC } "
@@ -47,10 +43,8 @@ def print_error(error_code, print_error=True):
4743 return None
4844 else :
4945 return error_message
50-
5146def clear_screen ():
5247 os .system ("cls" )
53-
5448def help_command (command = None ):
5549 if (command == None or command == "" ):
5650 clear_screen ()
@@ -101,18 +95,16 @@ def Bootloader():
10195 os .system ('color e0' )
10296 print ("B-Kernel" )
10397 print ("(c) B-Kernel, 2023" )
104- print ("Version 1.130 .0" )
98+ print ("Version 2.0 .0" )
10599 time .sleep (random .randint (2 , 5 ))
106100 clear_screen ()
107101 os .system ('color 0f' )
108102 print (f"{ bcolors .WARNING } Welcome to { bcolors .BOLD } B Kernel{ bcolors .ENDC } " )
109103 return True
110104 else :
111105 print_error ("0x001" )
112-
113- #Post-Determined Variables
106+ #Calling Bootloader
114107booted = Bootloader ()
115- #Default Directory: /workspaces/bkernel
116108while booted == True :
117109 command = str (input (os .getcwd () + " " ))
118110 locationdir = os .getcwd ()
@@ -320,4 +312,4 @@ def rem(val1,val2):
320312 time .sleep (random .randint (0 , 5 ))
321313 booted = False
322314 else :
323- print_error ("0x005" )
315+ print_error ("0x005" )
0 commit comments