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
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
Built Distribution
Close
Hashes for text-actions-girvel-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcfbec087bf3f96610b864006d0b652e5151f4b28c3d24924a9c4a070042df27 |
|
MD5 | 12ddf4226a89e02ffaba9ef3704f1eb6 |
|
BLAKE2b-256 | 8bfeba126ff954a4fa583eb9a84483dd535b8469fab7d6800d360fd0b0c7d83f |
Close
Hashes for text_actions_girvel-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edcadc6f893960317427a3a03352f7062b381449e45c83bc0a018297d2219054 |
|
MD5 | 75c3d70942dcfe73b4177fe78bf1fcd7 |
|
BLAKE2b-256 | 98be9a893d162efc1338acad5ba98a4bac626a57c5a6c1c0156a803789dc48b8 |