upload script

This commit is contained in:
chmodsayshello 2022-03-29 17:12:21 +00:00
parent 25ff05635a
commit 91b7e083c2
1 changed files with 46 additions and 0 deletions

46
tools/spacefix.py Normal file
View File

@ -0,0 +1,46 @@
#ONLY RUN FROM THE MCL5 TOOLS FOLDER!
__author__ = "chmodsayshello"
__license__ = "GPLv3"
__status__ = "Development"
#the ironic thing about this file is that i am going to made many many space /tab mistakes here xD
import os, sys
mcl5_dir = os.path.join(os.getcwd(), os.pardir)
print("Semi Warning: this only works if you run this from <yourmcl5foler>/tools, else its going to do it from any folder above from where you run it, just answer with 2 if thats the case")
print("")
print("WARNING: THIS IS GOING TO MAKE CHANGES WITHOUT ASKING YOU, MAKE A COPY OF YOUR CODE BEFORE RUNNING THIS!")
print("1: Continue")
print("2: Cancel")
print("")
answer = input("Please Enter 1 or 2, anthing else is invalid: ")
if answer == "1":
print("Thanks for your permission :), starting...")
else:
if answer == "2":
sys.exit("Operation cancelled by user!")
else:
sys.exit("Invalid input")
for root, dirs, files in os.walk(mcl5_dir):
for name in files:
if name.endswith(".lua"):
mod = open(os.path.join(root, name),"r")
line_original = mod.readlines()
for i in range(0, len(line_original)):
line_original[i] = line_original[i].replace(" ", '\t')
mod.close()
mod = open(os.path.join(root, name), "w")
mod.writelines(line_original)
mod.close()
print("DONE! check if mcl5 still works!")