Skip to content

Commit e409f0c

Browse files
authored
Update corebench.py
1 parent 66b9dda commit e409f0c

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

corebench/corebench.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def distroColour():
307307
quit()
308308

309309
#UPDATE THIS WITH EVERY VERSION
310-
version = "1.5.2"
310+
version = "1.5.3"
311311
#UPDATE THIS WITH EVERY VERSION
312312

313313
endLoad = True
@@ -1546,21 +1546,26 @@ def showHome():
15461546
multiArgs = False
15471547
skip = False
15481548

1549-
choice = input("=> ")
1550-
choice = choice.lower().strip(" ")
1549+
selection = input("=> ")
1550+
selection = selection.lower().strip(" ")
15511551

15521552
# Handle case for *x syntax
1553-
if "*" in choice:
1554-
num_part = choice.split(" ")[0]
1555-
num = int(num_part.strip("*"))
1556-
choice = choice[len(num_part):].strip() # Remove the *x part
1553+
if "*" in selection:
1554+
choice, num = selection.split("*")[0].strip(), selection.split("*")[1].strip()
1555+
1556+
try:
1557+
num = int(num.strip())
1558+
except:
1559+
num = int(re.sub(r"-\s*d", "", num.strip()))
15571560
else:
1561+
choice = selection.split("-")[0].strip() if "-" in selection else selection
15581562
num = 1 # Default to 1 if no *x syntax is used
15591563

1560-
if choice in otherChoice:
1561-
if choice == "exit" or choice == "quit":
1564+
if selection in otherChoice:
1565+
if selection == "exit" or selection == "quit":
15621566
quit()
1563-
elif choice == "clear":
1567+
1568+
elif selection == "clear":
15641569
print(f"Are you sure you want to {colours.red()}clear ALL data{colours.reset()}? (y/n)")
15651570
confirm = input("=> ")
15661571

@@ -1580,15 +1585,19 @@ def showHome():
15801585
print(f"{colours.green()}Data cleared{colours.reset()}.")
15811586
else:
15821587
print(f"{colours.red()}Data not cleared{colours.reset()}.")
1588+
15831589
else:
15841590
try:
15851591
# Checks to see if it contains args
15861592
try:
1587-
choice, args = choice.split(" -")
1593+
args = selection.split(" -")[1]
15881594
except:
1589-
choice, args = choice.split("-")
1595+
args = selection.split("-")[1]
1596+
finally:
1597+
pass
15901598

15911599
multiArgs = True
1600+
15921601
if choice in validChoice:
15931602
skip = False
15941603
else:
@@ -1608,24 +1617,26 @@ def showHome():
16081617
dynamicMode = False
16091618
valid = True
16101619
# Checks for correct base but no args
1620+
16111621
elif args == "d":
16121622
dynamicMode = True
16131623
valid = True
16141624
# Dynamic mode
1625+
16151626
else:
16161627
dynamicMode = False
16171628
valid = False
16181629
# No valid arguments
16191630

16201631
else:
16211632
valid = False
1622-
if choice.strip(" ") != "":
1633+
if selection.strip(" ") != "":
16231634
print(f"{colours.red()}Invalid command{colours.reset()}")
16241635
else:
16251636
clear()
16261637
print(f"Please enter the {colours.magenta()}test command{colours.reset()}.")
16271638
# Invalid base
1628-
1639+
16291640
base = choice
16301641
index = -1 # Initialize index with a default value
16311642

0 commit comments

Comments
 (0)