goIPyJoyLoLAdaptor

package
v0.0.0-...-2d93f61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

The goIPyJoyLoLAdaptor provides the interface from the goIPyKernel (part of the goIPythonKernelToolkit) and the cJoyLoL runtime instance of JoyLoL.

Some of the folowing GoDoc documentation, such as the `Dir`, as well as the `FSXXX` functions, come from our use of Matt Jibson's esc tool (https://github.com/mjibson/esc) to embed the IPyJoyLoL.joy code directly into the IPyJoyLoL kernel executable itself.

Index

Constants

View Source
const (
	// Version defines the goIPyJoyLoL version.
	Version string = "1.0.0"
)

Variables

This section is empty.

Functions

func Dir

func Dir(useLocal bool, name string) http.FileSystem

Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

func FS

func FS(useLocal bool) http.FileSystem

FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSByte

func FSByte(useLocal bool, name string) ([]byte, error)

FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSMustByte

func FSMustByte(useLocal bool, name string) []byte

FSMustByte is the same as FSByte, but panics if name is not present.

func FSMustString

func FSMustString(useLocal bool, name string) string

FSMustString is the string version of FSMustByte.

func FSString

func FSString(useLocal bool, name string) (string, error)

FSString is the string version of FSByte.

Types

type GoAdaptor

type GoAdaptor struct {

	// AdaptorIdFormat is a string which together with the ExecCounter and
	// ExecSubCounter forms the ExecName to uniquely identify this kernel for
	// a human user.
	//
	AdaptorIdFormat string

	// IPyJoyLoLDebugging determines whether or not to send debugging
	// information to Jupyter via stdout
	//
	IPyJoyLoLDebugging bool

	// The JoyLoL State
	//
	JoyLoL *cJoyLoL.JoyLoLState
}

GoAdaptor represents any state required by the adaptor. /

func NewGoAdaptor

func NewGoAdaptor() *GoAdaptor

Create a new adaptor.

func (*GoAdaptor) EvaluateCode

func (adaptor *GoAdaptor) EvaluateCode(
	execCounter int,
	execSubCounter int,
	code string,
) (rtnData tk.Data, err error)

Evaluate the code and return the results as a Data object.

func (*GoAdaptor) EvaluateRemoveSpecialCommands

func (adaptor *GoAdaptor) EvaluateRemoveSpecialCommands(
	outErr tk.OutErr,
	code string,
) string

Evaluate (and remove) any implmenation specific special commands BEFORE the code gets evaluated by the interpreter. The `outErr` variable contains the stdOut and stdErr which can be used to capture the stdOut and stdErr of any external commands run by these special commands.

Not currently implemented for the IPyJoyLoL kernel.

func (*GoAdaptor) GetCodeWordCompletions

func (adaptor *GoAdaptor) GetCodeWordCompletions(
	code string,
	cursorPos int,
) (int, int, []string)

Get the possible completions for the word at cursorPos in the code.

Not currently implemented for the IPyJoyLoL kernel.

func (*GoAdaptor) GetKernelInfo

func (adaptor *GoAdaptor) GetKernelInfo() tk.KernelInfo

GetKernelInfo returns the KernelInfo for this kernel implementation.

func (*GoAdaptor) SetupDisplayCallback

func (adaptor *GoAdaptor) SetupDisplayCallback(receipt tk.MsgReceipt)

Setup the Display callback by recording the msgReceipt information for later use by what ever callback implements the "Display" function.

Not currently implemented for the IPyJoyLoL kernel.

func (*GoAdaptor) TeardownDisplayCallback

func (adaptor *GoAdaptor) TeardownDisplayCallback()

Teardown the Display callback by removing the current msgReceipt information and setting things back to what ever default the implementation uses.

Not currently implemented for the IPyJoyLoL kernel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL