Skip to content

Commit 8d03773

Browse files
Pending changes exported from your codespace (#51)
1 parent 60beb2c commit 8d03773

2 files changed

Lines changed: 14 additions & 28 deletions

File tree

linux.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#Imported Variables
12
import os
23
import shutil
34
import subprocess
@@ -10,8 +11,7 @@
1011
cmancode = subprocess.Popen(["python", str(locationdir) + "/bin/functions/registry/r~1.py"])
1112
subprogram = False
1213
booted = False
13-
14-
# Colors | For more help; see https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal
14+
# Colors
1515
class bcolors:
1616
HEADER = '\033[95m'
1717
OKBLUE = '\033[94m'
@@ -22,17 +22,15 @@ class bcolors:
2222
ENDC = '\033[0m'
2323
BOLD = '\033[1m'
2424
UNDERLINE = '\033[4m'
25-
26-
# The error codes are in this dictionary for easy re-use; add new ones whenever you wish :)
25+
# Error Codes
2726
error_codes = {
2827
"0x001": "The 'bootloader' instance is already running.",
2928
"0x002": "The item you were searching for was not found.",
3029
"0x003": "The file cannot be executed.",
3130
"0x004": "The directory is not accessible.",
3231
"0x005": "That command doesn't exist. Type 'help' for a list of available commands."
3332
}
34-
35-
# Print error function for easy re-use; make sure to use the correct error code
33+
# Declaring Functions
3634
def print_error(error_code, print_error=True):
3735
try:
3836
error_message = f"{bcolors.FAIL}Error code {error_code}: {error_codes[error_code]}{bcolors.ENDC}"
@@ -44,10 +42,8 @@ def print_error(error_code, print_error=True):
4442
return None
4543
else:
4644
return error_message
47-
4845
def clear_screen():
4946
os.system("clear")
50-
5147
def help_command(command=None):
5248
if (command == None or command == ""):
5349
clear_screen()
@@ -97,17 +93,15 @@ def Bootloader():
9793
if booted == False:
9894
print("B-Kernel")
9995
print("(c) B-Kernel, 2023")
100-
print("Version 1.130.0")
96+
print("Version 2.0.0")
10197
time.sleep(random.randint(2, 5))
10298
clear_screen()
10399
print(f"{bcolors.WARNING}Welcome to {bcolors.BOLD}B Kernel{bcolors.ENDC}")
104100
return True
105101
else:
106102
print_error("0x001")
107-
108-
#Post-Determined Variables
103+
#Calling Bootloader
109104
booted = Bootloader()
110-
#Default Directory: /workspaces/bkernel
111105
while booted == True:
112106
command = str(input(os.getcwd() + " "))
113107
locationdir = os.getcwd()
@@ -315,4 +309,4 @@ def rem(val1,val2):
315309
time.sleep(random.randint(0, 5))
316310
booted = False
317311
else:
318-
print_error("0x005")
312+
print_error("0x005")

windows.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
#Imported Variables
12
import os
23
import shutil
34
import subprocess
45
from sys import version_info
5-
66
os.system('color')
7-
87
# Pre-determined variables
98
location = 0
109
locationdir = os.getcwd()
@@ -13,8 +12,7 @@
1312
cmancode = subprocess.Popen(["python", str(locationdir) + "/bin/functions/registry/r~1.py"])
1413
subprogram = False
1514
booted = False
16-
17-
# Colors | For more help; see https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal
15+
# Colors
1816
class 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
3027
error_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
3935
def 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-
5146
def clear_screen():
5247
os.system("cls")
53-
5448
def 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
114107
booted = Bootloader()
115-
#Default Directory: /workspaces/bkernel
116108
while 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

Comments
 (0)