mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Add files via upload
This commit is contained in:
parent
8903a3ca8f
commit
cdd086bb98
|
@ -1,16 +1,12 @@
|
||||||
var SHELL = require("lib/shell");
|
var SHELL = require("lib/shell");
|
||||||
|
|
||||||
function PythonObject() {
|
function PythonObject(platform) {
|
||||||
this.version = "3.10.2-embed";
|
this.version = "3.10.2-embed";
|
||||||
this.platform = "amd64";
|
this.platform = platform;
|
||||||
|
|
||||||
this.setVersion = function(version) {
|
this.setVersion = function(version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setPlatform = function(platform) {
|
|
||||||
this.platfrom = platform;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.execScript = function(scriptName, args) {
|
this.execScript = function(scriptName, args) {
|
||||||
return SHELL.exec([
|
return SHELL.exec([
|
||||||
|
@ -18,18 +14,26 @@ function PythonObject() {
|
||||||
scriptName
|
scriptName
|
||||||
].concat(args));
|
].concat(args));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.runScript = function(scriptName, args) {
|
||||||
|
return SHELL.show([
|
||||||
|
"bin\\python-" + this.version + "\\" + this.platform + "\\python",
|
||||||
|
scriptName
|
||||||
|
].concat(args));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.PythonObject = PythonObject;
|
exports.PythonObject = PythonObject;
|
||||||
|
|
||||||
exports.create = function() {
|
exports.create = function(platform) {
|
||||||
return new PythonObject();
|
var platform = (typeof platform !== "undefined" ? platform : "amd64");
|
||||||
|
return new PythonObject(platform);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.execScript = function(scriptName, args) {
|
exports.execScript = function(scriptName, args) {
|
||||||
return (new PythonObject()).execScript(scriptName, args);
|
return (new PythonObject()).execScript(scriptName, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Python Interface (python3.js) version 0.1";
|
exports.VERSIONINFO = "Python Interface (python3.js) version 0.2";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user