Skip to main content

An extension program to curses that offers option menus, message boxes, file dialogues and more

Project description

Curses Plus

Extension library to curses

How To Install

Use pip3 install cursesplus on Linux or py -m pip install cursesplus on Windows

SPECIAL INSTRUCTIONS FOR WINDOWS

For Windows you need to also install windows-curses or related program to provide the basic curses functionality

What's New?

3.20

  • A big round number means a big update

  • Add searchable_option_menu, which allows you to filter large amounts of options live using regex.

3.19

  • Rewrite date and time selector

  • Same arguments, but it has an all-new and very nice UI

3.18:

  • Add bargraph to show a bargraph

  • Add savefile_selector() to be able to prompt the user to save a file.

  • textview can now save to a file

  • Add the ability to show/hide the cursor when activated

NOTICE! 3.x - Breaking Changes

The following changes likely require changes in your code

  • Move filline, showcursor, and hidecursor to a new module called utils.

  • Fix spelling issue, utils.filline is now utils.fill_line

  • Change displayops to optionmenu. Please refactor all calls from displayops() to optionmenu(): No other changes are required

  • Remove legacy function showerror. Use messagebox.showerror as a replacement

  • Remove legacy function askyesno_old. Use messagebox.askyesno as a replacement

  • Combine displaymsg and displaymsgnodelay into one function

  • Existing displaymsgnodelay calls can be changed to displaymsg(stdscr,[messages],False), so change the flag wait_for_keypress to false

  • Remove redundant american function set_color. You can either use the (correct) spelling set_colour or you can not use this library.

Documentation

transitions.py

transitions contains many transitions to add animations to your program

__exec(func,args)

NOTE: THIS IS AN INTERNAL FUNCTION, IT IS NOT MEANT TO BE USED BY THE COMMON USER

This executes func(args)

horizontal_bars(stdscr,func_to_call=None,args=(),speed=1)

This is a replacement function to old's type zero. It fills the screen from the top down with horizontal white bars. It then replaces them with black bars in the same configuration.

  • stdscr is a curses window object

  • func_to_call is a function. If it is set to none, no function is called

  • args is a tuple. The tuple will be passed to the function as arguments

  • speed is an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.

random_blocks(stdscr,func_to_call=None,args=(),speed=1)

This is a replacement for old's type one transition. It fills random characters of the screen with blocks until the whole screen is covered, then it removes it in the same fashion.

  • stdscr is a curses window object

  • func_to_call is a function. If it is set to none, no function is called

  • args is a tuple. The tuple will be passed to the function as arguments

  • speed is an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.

vertical_bars(stdscr,func_to_call=None,args=(),speed=1)

This is an all new transition. It functions like horizontal bars except they are vertical and go left to right.

  • stdscr is a curses window object

  • func_to_call is a function. If it is set to none, no function is called

  • args is a tuple. The tuple will be passed to the function as arguments

  • speed is an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.

utils.py

Utils.py Contain a series of non-ui utility functions. By non-ui I mean that it does not show a screen and it is non-interactive. It is meant to enhance the creation of custom menus.

fill_line(stdscr,line,colour)

This function fills row line with the colour colour.

  • stdscr is a curses window object

  • line is an int. It is the row number you wish to fill in

  • colour is a curses colour. Use cursesplus.set_colour() for this

hidecursor()

This function hides the console cursor

showcursor()

This function shows the console cursor

constants.py

constants.py contains a series of constants such as colours and special lines.

** This documentation is not yet complete. There are many more features than this **

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

cursesplus-3.20.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cursesplus-3.20.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file cursesplus-3.20.1.tar.gz.

File metadata

  • Download URL: cursesplus-3.20.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cursesplus-3.20.1.tar.gz
Algorithm Hash digest
SHA256 4b5baa4a296e95ffe6daea9e12f8b0aac6672d5352e51ed396edb6b21d3d7dae
MD5 ed57571bb0a989e4f709f622a00eec8f
BLAKE2b-256 78436e7fb8e9dc8bff57bcc15dd245a156a23da439a9328e5928718e275972a5

See more details on using hashes here.

File details

Details for the file cursesplus-3.20.1-py3-none-any.whl.

File metadata

  • Download URL: cursesplus-3.20.1-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cursesplus-3.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 740ce0ddd7fe1a073908618b7b510f385ddd83bf9f5cb367c01ad5983f17eaf9
MD5 17057165425f0e9d4b23e526cf7005ae
BLAKE2b-256 654ccf439268068ef3b0b79aa3ec1519bdc3ec15bafe277559c29919accdd2b8

See more details on using hashes here.

Supported by

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