Compile script beauty fixes

This commit is contained in:
BotoX 2017-08-02 22:33:40 +02:00
parent 29e1313f91
commit 0749b4de9c
2 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,11 @@ import os
import sys import sys
import subprocess import subprocess
c_null = "\x1b[00;00m"
c_red = "\x1b[31;01m"
c_blue = "\x1b[34;01m"
c_green = "\x1b[32;01m"
SM_INCLUDES = "includes" SM_INCLUDES = "includes"
SPCOMP = "./spcomp" SPCOMP = "./spcomp"
@ -14,12 +19,13 @@ if __name__ == "__main__":
Plugins.append(Directory) Plugins.append(Directory)
for Plugin in Plugins: for Plugin in Plugins:
print("Compiling {0}".format(Plugin)) print(c_red + "### Compiling {0}".format(Plugin) + c_null)
SourcePath = os.path.join(Plugin, "scripting") SourcePath = os.path.join(Plugin, "scripting")
Path, Directories, Files = next(os.walk(SourcePath)) Path, Directories, Files = next(os.walk(SourcePath))
for File in Files: for File in Files:
if File.endswith(".sp"): if File.endswith(".sp"):
print(c_green + "# Compiling {0} ({1})".format(os.path.basename(File), Plugin) + c_null)
SourcePath = os.path.join(Path, File) SourcePath = os.path.join(Path, File)
IncludePath = os.path.join(Path, "include") IncludePath = os.path.join(Path, "include")
OutDir = "plugins" OutDir = "plugins"
@ -35,3 +41,5 @@ if __name__ == "__main__":
subprocess.run(Compiler, check=True) subprocess.run(Compiler, check=True)
except Exception: except Exception:
sys.exit(1) sys.exit(1)
print("")

View File

@ -21,8 +21,8 @@ if __name__ == "__main__":
SourcePath = os.path.join(Plugin, "scripting") SourcePath = os.path.join(Plugin, "scripting")
Path, Directories, Files = next(os.walk(SourcePath)) Path, Directories, Files = next(os.walk(SourcePath))
for File in Files: for File in Files:
print('\n' + c_green + "# Compiling {0} ({1})".format(os.path.basename(File), Plugin) + c_null)
if File.endswith(".sp"): if File.endswith(".sp"):
print(c_green + "# Compiling {0} ({1})".format(os.path.basename(File), Plugin) + c_null)
SourcePath = os.path.join(Path, File) SourcePath = os.path.join(Path, File)
IncludePath = os.path.join(Path, "include") IncludePath = os.path.join(Path, "include")
OutDir = "plugins" OutDir = "plugins"
@ -38,3 +38,5 @@ if __name__ == "__main__":
subprocess.run(Compiler, check=True) subprocess.run(Compiler, check=True)
except Exception: except Exception:
sys.exit(1) sys.exit(1)
print("")