it is now backed by a python node. I'm leveraging litegraph custom widgets in a bit of an hacky way. The main idea is: - python endpoints for the editor: to execute, lint, format code live without queuing anything, this doesn't support inputs but you can use the `IS_LIVE` global variable to conditionally set inputs. - a backend singleton class that is used to execute both the live and "in flow" version. - a custom widget `CODE_EDITOR` that wraps ACE editor automatically adding the needed de/serialization hooks on the node it targets TLDR this node can be either used as a scratchpad akin to a notebook, isolated from the graph, or part of the graph and can receive inputs and produce outputs
15 lines
248 B
JavaScript
15 lines
248 B
JavaScript
/** Python REPL for the frontend (uses rich)*/
|
|
|
|
import { app } from '../../scripts/app.js'
|
|
|
|
// import * as mtb_ui from './mtb_ui.js'
|
|
|
|
// #endregion
|
|
|
|
const repl = {
|
|
name: 'mtb.repl',
|
|
|
|
// async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
|
}
|
|
|