UNPKG

create-chuntianxiaozhu

Version:

春天小猪模板工具

49 lines (43 loc) 1.07 kB
const { Controller } = require("ee-core"); const { mjsModule } = require("../utils/mjsmodule"); const Ps = require("ee-core/ps"); const { resolve } = require("path"); const { getRequirementTxt } = require("../utils/env"); /** * 环境配置控制器 * @class */ class PythonController extends Controller { constructor(ctx) { super(ctx); } /** * 所有方法接收两个参数 * @param args 前端传的参数 * @param event - ipc通信时才有值。详情见:控制器文档 */ async run(id) { const { pythonenv } = mjsModule; const { python } = pythonenv; // 如果是第一次需要下载脚本 try { await python({ file: resolve(Ps.getExtraResourcesDir(), "main.window.py"), }); return true; } catch { return false; } } /** * 获取自动化脚本类目 * @param {*} args */ async category(args) {} /** * 获取类目脚本列表 */ async scripts() {} } PythonController.toString = () => "[class PythonController]"; module.exports = PythonController;