Skip to content

Latest commit

 

History

707 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dialoghelper

Usage

Installation

Install from pypi

$ pip install dialoghelper

Documentation

Documentation can be found hosted on this GitHub repository’s pages.

Dialog identity and filenames

Current-session reads, edits, execution and browser callbacks use dh_settings['kid'], initialized from RUSTYGATE_KERNEL_ID. The gateway owns the notebook binding. Renames and restarts retain the kernel id. curr_dialog(dname='') returns the notebook’s current name and mode from the gateway. Explicit dname arguments remain file-based.

Dialog names include .ipynb. Inputs such as lesson.ipynb resolve relative to the current dialog’s folder. A leading slash, as in /project/lesson.ipynb, addresses the gateway root rather than the disk root. find_dname and curr_dialog return gateway-root-relative filenames without a leading slash. list_dialogs retains notebook extensions and marks folders with a trailing slash.

realpath() returns the gateway’s on-disk root. realpath('') and list_dialogs() default to the current notebook’s folder. Relative subpaths use that folder even after a notebook rename, not the kernel’s mutable cwd. A leading slash uses the gateway root. realpath accepts prospective paths without creating them. .. can move up within the root. The gateway resolves symlinks within its root and rejects dangling symlinks and paths escaping the root. Notebook-relative paths require a bound kernel.

Folder-local skills

Solveit activates pyskills from the dialog’s opening folder before loading its tool layer. Put a public .py module or package in a _pyskills/ directory there or in an ancestor. Give it a module docstring. list_pyskills() discovers it and ordinary imports load it without an install or entry-point declaration. The nearest local folder wins. Changing cwd or moving a live dialog does not change the selected scope; restart its kernel to use the new location. Function permissions remain separate from discovery.

About

Helper functions for solveit dialogs

Resources

Stars

26 stars

Watchers

7 watching

Forks

Releases

Used by

Contributors

Languages