Skip to main content

Sancty is an extension to jquast/blessed for simple editor-like terminal apps

Project description

Sancty

Sancty is an extension to jquast/blessed for simple editor-like terminal apps

Usage

Sancty has two major components, Reader (which follows the ReaderProtocol) and Renderer (which follows the RendererProtocol). As you are free to choose your own communication channel and event loop/threading architecture, these do not work out of the box. For implementations that work out of the box, take a look at ProcessReader and ProcessRenderer, which use standard multiprocessing classes to each run on their own thread. You can also spin up a basic editor by running start_terminal().

If you don't want to customize the run architecture, but do want to customize the Reader and Renderer classes, simply extend them (but be sure to still conform to their respective protocols) and pass the classes as variables to start_terminal().

You can also pass a custom replace_dict, which is a dictionary of all possible \\ commands. By default, the key swill correspond to strings that will be replaced by the value strings, but if the key is an integer, a custom special_slash_fn can also be passed to perform arbitrary transformations of the render array. Note that all negative numbers are reserved for this program.

Default \\ commands

default_replace_dict = {
    "clr": (-1, "Clears all text"),
    "help": (-2, "Shows all slash commands"),
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sancty-0.2.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

sancty-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file sancty-0.2.0.tar.gz.

File metadata

  • Download URL: sancty-0.2.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sancty-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b8ecfe4e82a033269c0c97f1fe3e5af2452fa18b05735d0f237d970328e72f8e
MD5 cfc87bea4c3d4c9a97ce98ab95c31b52
BLAKE2b-256 792635bd2ff583c7c7e86cc6d94e815e3a7240574c2a4630778ea02521fee606

See more details on using hashes here.

File details

Details for the file sancty-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sancty-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sancty-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d2d96064904cdd1d804e8af83a1b203e102a018f897a855f749b6e9f8e9184
MD5 de49bafa6d67472920467f4996d91098
BLAKE2b-256 d9eb928a2df07b53ae316712d5904005ed4ec4ea04ff834c7ef6b9ccaa1c30b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page