You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 9, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: helper.js
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ le._apps.py93 = {
21
21
this.arg.command=="py93 c help"||
22
22
this.arg.command=="py93 c h"
23
23
){
24
-
$log('Py93 Menu: py93compile: usage:\npy93 [compile or c] [?help or h] [filepath] [?--name NAME] [--packages-ignore or -pi]\n===========================================================\nUse "help" or "h" to see this help message.\nfilepath - path to .py file that needs to be compiled\n--name NAME - output file name.\nExample: "py93 c /a/w93.py --name windows93" => file w93.py in /a/ has been compiled and saved as windows93.html.\n(If there\'s no --name option, the target file name will be the same as the source.)\n--packages-ignore or -pi - use these options if don\'t want to load packages from "packages" folder in the compiled file.\nWorking command example: py93 c /a/w93.py --name windows93');
24
+
$log('Py93 Menu: py93compile: usage:\npy93 [compile or c] [help or h] [filepath] [--name NAME] [--packages-ignore or -pi] [-o or --out OUTDIR]\n===========================================================\nUse "help" or "h" to see this help message.\nfilepath - path to .py file that needs to be compiled\n--name NAME - output file name.\nExample: "py93 c /a/w93.py --name windows93" => file w93.py in /a/ has been compiled and saved as windows93.html.\n(If there\'s no --name option, the target file name will be the same as the source.)\n--packages-ignore or -pi - use these options if don\'t want to load packages from "packages" folder in the compiled file.\n-o or --out OUTDIR - use these options to set the output directory.\n(If there\'s no --out or -o option, the standard output directory will be used (/a/Py93/compiled/))\nWorking command example: py93 c /a/w93.py --name windows93 -pi --out a/desktop');
if(outdir[0]=="c")$log.red('py93compile: compiler error: can\'t write to /c/, using standard output directory.');
77
+
else$log.red('py93compile: compiler error: wrong output directory, using standard output directory.');
78
+
}else{
79
+
outdir=outdir.substr(1)// /path/
80
+
}
81
+
if(!wrong){
82
+
outdir=outdir.substr(1)// path/
83
+
if('/'!=outdir.slice(-1)){// path => path/
84
+
outdir+='/';
85
+
}
86
+
}else{
87
+
outdir=stdoutdir;
88
+
}
65
89
}
66
90
});
67
91
/**
@@ -119,7 +143,8 @@ le._apps.py93 = {
119
143
filename=$fs.utils.getName(compFile);
120
144
filename=$fs.utils.replaceExt(filename,"html");
121
145
}
122
-
varcompNameFin='Py93/compiled/'+filename;
146
+
varcompNameFin=outdir+filename;
147
+
//$log(compNameFin)
123
148
$db.set(compNameFin,htmlfile);
124
149
$log.green('Finished compilation.\nCompiled file path: /a/'+compNameFin+'\nWrite "$explorer.refresh();" to the terminal to make compiled file visible.');// FIXME: Need to fix a bug when using $explorer.refresh() in the script does nothing
0 commit comments