Skip to main content

Package for managing UI commands in text package in bash syntax

Project description

This is a simple Python package I used to test packaging mechanism in Python. Also it provides a possibility to manage your UI text commands in bash-like syntax like :open last.org or delete 1.

from text_actions import ui_action

actions = []

@ui_action(actions, 'd', 'delete')
def delete_action(state, index='-1'):
    index = int(index)
    if index < 0:
        index += len(state.activities)
    state.activities = state.activities[:index] + state.activities[index + 1:]

This code will create a library of commands inside the actions variable, that you can use as argument in apply_action. First argument is always the state of application, other arguments are receivied from user's command. You probably should not worry about cast exceptions, I usually catch them in the UI code.

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

text-actions-girvel-0.0.2.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

text_actions_girvel-0.0.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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