Skip to main content

No project description provided

Project description

Goals
=====

A collection of curses utils for performing simple UI tasks.
Currently this includes a simple console and a menu with
vi-like bindings.

Installation
============

Requires python 3.

``pip3 install curses-util`` should do the trick, or else
``python setup.py install`` from source.

Usage
=====

SimpleConsole
-------
A simple console with a single line input window.

::

import curses_util

def handle_input(console, input):
console.log("Got input: " + input) #Logs result to the output window.

console = curses_used.SimpleConsole(handle_input)
console.log("Welcome")

Menu
----

This can be used to vend a collection of items which the user may then select
one or more of. Navigation can be performed using standard vi bindings (count
operands are also supported) or via the arrow keys. Multiple items can be
selected with 'multi_vend()' if the user presses m over each of the items they
wish to select and then presses enter.

::

import curses_util

menu = curses_util.Menu()

items = [ str(i) for i in range(100) ]
selected = menu.vend(items)

print("The following items were selected: \n")
print("\n".join(items), "\n")

Bugs, etc..
===========

If you bother to read the code and invariably feel the need to abuse
the person who wrote it, know that such sentiments will be happily
received at r.vaiya@gmail.com.

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

curses-util-0.0.7.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file curses-util-0.0.7.tar.gz.

File metadata

  • Download URL: curses-util-0.0.7.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for curses-util-0.0.7.tar.gz
Algorithm Hash digest
SHA256 20455813372389c6934dc671a140f9c9b327f6ff14aa65405ac007567069be5d
MD5 dd56bc96a552e6ea6b0ad57e63ec8778
BLAKE2b-256 e54c01689c4a6fc748b151dbbda15176fe41aeaeab62723af98bf24cc0215373

See more details on using hashes here.

Supported by

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