From d68912f5e59d251204a5ad8394059c6683e9dbc8 Mon Sep 17 00:00:00 2001 From: bleck9999 <55853712+bleck9999@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:46:48 +0100 Subject: [PATCH 1/3] crab _min is gone crab (also stdlib updates) --- ts-minifier.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ts-minifier.py b/ts-minifier.py index b43baf0..b8a6208 100644 --- a/ts-minifier.py +++ b/ts-minifier.py @@ -1,6 +1,6 @@ # Copyright (c) 2021 bleck9999 # https://github.com/bleck9999/ts-minifier -# Version: 4fc47b37 +# Version: b9ea46f3 import argparse import re @@ -11,7 +11,8 @@ sub_funcs = {'while': "_h", 'print': "_p", 'println': "_l", 'mountsys': "_s", 'm 'mkdir': "_k", 'memory': "_m", 'ncatype': "_n", 'pause': "_w", 'color': "_a", 'menu': "__", 'emu': "_u", 'clear': "_x", 'timer': "_t", 'deldir': "_g", 'fsexists': "_f", 'delfile': "_z", "copydir": "c_", "movefile": "_v", "payload": "_j", "readfile": "_o", "writefile": "w_", "setpixels": "y_", "printpos": "p_", - "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_"} + "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_", "escapepath": "x_", + "combinepath": "a_"} replace_functions = False @@ -177,5 +178,8 @@ if __name__ == '__main__': with open(file, 'r') as f: r = minify(f.read()) file = file.split(sep='.')[0].split(sep='/')[-1] - f = open(f"{dest}/{file}_min.te", 'w') + if dest != '.': + f = open(f"{dest}/{file}.te", 'w') + else: + f = open(f"{dest}/{file}_min.te", 'w') f.write(r) From 205e0510d14ff5051e39dc92a6e74fd3084d0677 Mon Sep 17 00:00:00 2001 From: bleck9999 <55853712+bleck9999@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:56:53 +0100 Subject: [PATCH 2/3] speed --- ts-minifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts-minifier.py b/ts-minifier.py index b8a6208..9088fa2 100644 --- a/ts-minifier.py +++ b/ts-minifier.py @@ -1,6 +1,6 @@ # Copyright (c) 2021 bleck9999 # https://github.com/bleck9999/ts-minifier -# Version: b9ea46f3 +# Version: 0793d0a7 import argparse import re @@ -12,7 +12,7 @@ sub_funcs = {'while': "_h", 'print': "_p", 'println': "_l", 'mountsys': "_s", 'm 'clear': "_x", 'timer': "_t", 'deldir': "_g", 'fsexists': "_f", 'delfile': "_z", "copydir": "c_", "movefile": "_v", "payload": "_j", "readfile": "_o", "writefile": "w_", "setpixels": "y_", "printpos": "p_", "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_", "escapepath": "x_", - "combinepath": "a_"} + "combinepath": "a_", "cwd": "d_"} replace_functions = False From 39d2ef3e8a9f4b0a68b0ca3789f8440f08426353 Mon Sep 17 00:00:00 2001 From: bleck9999 <55853712+bleck9999@users.noreply.github.com> Date: Tue, 27 Jul 2021 20:07:36 +0100 Subject: [PATCH 3/3] im forgetting things --- ts-minifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts-minifier.py b/ts-minifier.py index 9088fa2..986953b 100644 --- a/ts-minifier.py +++ b/ts-minifier.py @@ -1,6 +1,6 @@ # Copyright (c) 2021 bleck9999 # https://github.com/bleck9999/ts-minifier -# Version: 0793d0a7 +# Version: 360e126a import argparse import re @@ -8,7 +8,7 @@ import re # if is not included because it's already 2 characters sub_funcs = {'while': "_h", 'print': "_p", 'println': "_l", 'mountsys': "_s", 'mountemu': "_e", 'readsave': "_r", 'exit': "_q", 'break': "_b", 'dict': "_d", 'setpixel': "_y", 'readdir': "_i", 'copyfile': "_c", - 'mkdir': "_k", 'memory': "_m", 'ncatype': "_n", 'pause': "_w", 'color': "_a", 'menu': "__", 'emu': "_u", + 'mkdir': "_k", 'ncatype': "_n", 'pause': "_w", 'color': "_a", 'menu': "__", 'emu': "_u", 'clear': "_x", 'timer': "_t", 'deldir': "_g", 'fsexists': "_f", 'delfile': "_z", "copydir": "c_", "movefile": "_v", "payload": "_j", "readfile": "_o", "writefile": "w_", "setpixels": "y_", "printpos": "p_", "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_", "escapepath": "x_",