vspyx.Scripting
Package Contents
Classes
A Component with a Tick() function, and rules about when to call it. |
|
Module |
|
A Scripting::Component whose Tick() function is implemented in Python. |
|
PythonScript |
|
Script |
|
TextAPI |
- class vspyx.Scripting.Component
Bases:
vspyx.Runtime.Component
A Component with a Tick() function, and rules about when to call it.
- ComponentStart(self) Any
- EnvironmentInitialize(self) Any
- EnvironmentShutdown(self) Any
- Tick(self) Any
Execute the contents of the Scripting::Component
Generally this is called on the ticking thread, triggered by Trigger(), rather than being called directly.
- Trigger(self) Any
Schedule the Tick to be executed as soon as possible
Generally you want to call this rather than Tick() directly, so that Tick() is executed on its own thread and will not block the current thread.
- class vspyx.Scripting.FunctionBlock
- class vspyx.Scripting.FunctionBlock
Bases:
vspyx.Runtime.Component
A collection of steps that generate a PythonComponent, which is automatically added as a child.
- class CompilationContext
CompilationContext
- class Func
Func
- Ops :List[str]
- PopIndent(self) Any
- PushIndentingOp(self, op: str) Any
- PushOp(self, op: str) Any
- Imports :Any
- Tick :FunctionBlock.CompilationContext.Func
- OnConfigurationMutation :vspyx.Core.Callback_634bd5c449
- CloneConfiguration(self) Any
- static New(config: Any) FunctionBlock
- Trigger(self) Any
Run the Function Block now
- class vspyx.Scripting.FunctionBlockStepHandler
- class vspyx.Scripting.FunctionBlockStepHandler
An object which compiles a particular FunctionBlock Step into a FunctionBlock’s CompilationContext.
- HandlesType :str
Returns the protobuf type string for the type that this StepHandler will handle.
- class vspyx.Scripting.Module
Bases:
vspyx.Core.Module
Module
- ActivePythonScript :PythonScript
- DeregisterFunctionBlockStepHandler(self, handler: FunctionBlockStepHandler) Any
- GetFunctionBlockStepHandler(self, stepType: str) FunctionBlockStepHandler
- NewPythonScript(self) PythonScript
- NewPythonScript(self, argv: List[str]) PythonScript
- NewPythonScript(self, argv: List[str], extraPackagePaths: List[str]) PythonScript
- RegisterFunctionBlockStepHandler(self, handler: FunctionBlockStepHandler) Any
- class vspyx.Scripting.PythonComponent
Bases:
Component
A Scripting::Component whose Tick() function is implemented in Python.
- Code :str
- OnConfigurationMutation :vspyx.Core.Callback_634bd5c449
- CloneConfiguration(self) Any
- static New(config: Any) PythonComponent
- class vspyx.Scripting.PythonScript
Bases:
Script
,vspyx.Core.Environment
PythonScript
- Application :vspyx.Core.Application
- LastErrorTraceback :str
- RunModule(self, mod: str) Any
- RunPath(self, path: str) Any
- RunSource(self, source: str) Any
- class vspyx.Scripting.Script
Bases:
vspyx.Core.Object
Script
- class RunResult
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- Error = 1
- Finished = 0
- Paused = 2
- LastError :str
Get a description of the last error that occured
- Returns:
description of the last error
- OnOutput :vspyx.Core.Callback_6ee07abf48
Callback for when the script produces text output
- OnStart :vspyx.Core.Callback_634bd5c449
Callback for when script starts
- Run(self) Script.RunResult
Run the script. In the case of an error, use GetLastError() to retreive error information.
- Returns:
result of running
- Stop(self) Any
- class vspyx.Scripting.TextAPI
Bases:
vspyx.Core.ResolverObject
TextAPI
- Script :PythonScript
- Execute(self, cmd: str) str
Execute a command
- Parameter cmd:
the command
- Returns:
the result
- Intellisense(self, additionalNamespace: str) List[str]
Perform an intellisense operation
This will provide available options in the current namespace, as well as additional namespace appended to it. Only full namespaces should be passed; partially finished namespaces should be handled by the client. The type of access should be included. For example, to get intellisense for the user typing “Core.St”, additionalNamespace should be “Core.”
- Parameter additionalNamespace:
an additional namespace after the current namespace
- Returns:
all available items