vspyx.Scripting

Package Contents

Classes

Component

A Component with a Tick() function, and rules about when to call it.

FunctionBlock

FunctionBlock

FunctionBlockStepHandler

FunctionBlockStepHandler

Module

Module

PythonComponent

A Scripting::Component whose Tick() function is implemented in Python.

PythonScript

PythonScript

Script

Script

TextAPI

TextAPI

class vspyx.Scripting.Component

Bases: vspyx.Runtime.Component

Inheritance diagram of vspyx.Scripting.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

Inheritance diagram of vspyx.Scripting.FunctionBlock

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

Inheritance diagram of vspyx.Scripting.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

Inheritance diagram of vspyx.Scripting.PythonComponent

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

Inheritance diagram of vspyx.Scripting.PythonScript

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

Inheritance diagram of vspyx.Scripting.Script

Script

class RunResult

Bases: enum.IntEnum

Inheritance diagram of vspyx.Scripting.Script.RunResult

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

Inheritance diagram of vspyx.Scripting.TextAPI

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

static New() TextAPI