Add FILE module import and init PythonObject

Imported the FILE module in python3.js and updated PythonObject to initialize the default Python binary path upon creation. Also removed the copyright year range from the file header.
This commit is contained in:
Namhyeon Go 2025-11-20 17:24:26 +09:00
parent 1a75388a69
commit 186561639e

View File

@ -1,5 +1,5 @@
// python3.js // python3.js
// Copyright 2019-2025, Namhyeon Go <gnh1201@catswords.re.kr> and the WelsonJS contributors. // Namhyeon Go <gnh1201@catswords.re.kr> and the WelsonJS contributors.
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
// https://github.com/gnh1201/welsonjs // https://github.com/gnh1201/welsonjs
// //
@ -7,6 +7,7 @@
// //
var SYS = require("lib/system"); var SYS = require("lib/system");
var SHELL = require("lib/shell"); var SHELL = require("lib/shell");
var FILE = require("lib/file");
function PythonObject() { function PythonObject() {
this.binPath = null; this.binPath = null;
@ -50,6 +51,9 @@ function PythonObject() {
scriptName scriptName
].concat(args)); ].concat(args));
}; };
// Initialize default Python binary path based on current version and system arch
this.create();
} }
exports.PythonObject = PythonObject; exports.PythonObject = PythonObject;