Create simple commands.
Project description
Simplipy-Python
How to use
Command
from simplipy_python import Command
def PrintArgs(Arguments):
print(Arguments)
CommandHandler = Command(CommandMessage="Run> ", StarterMessage=None) # StarterMessage is Optional.
CommandHandler.AddCommand(command_name="Print Arguments", command_function=PrintArgs)
CommandHandler.SetupCommands() # Setup Command Module.
It should look like this:
Category
from simplipy_python import Command, Category
def PrintArgs(Arguments):
print(Arguments)
def PrintArgsCategory(Arguments):
print(f"Category {Arguments}")
CommandHandler = Command(CommandMessage="Run> ", StarterMessage="Category Test!!!")
CommandHandler.AddCommand(command_name="Print Arguments", command_function=PrintArgs)
Category1 = Category(category_name="Other Functions") # Create Category
Category1.AddCommand(command_name="Print Arguments 1", command_function=PrintArgsCategory) # Add Function
CommandHandler.SetupCommands(Categories=[Category1]) # Inject the Categories into the Setup
BEFORE TRYING THIS, PLEASE TYPE IN THE CATEGORY NAME
Case Sensitive
Commands Run> Other-Functions
Should look like this:
Help Command
$ python filename.py -h
usage: prog.py [-h] [--changelog]
options:
-h, --help show this help message and exit
-cl, --changelog The python package's changelog
Exceptions
NotValidCommand
Is raised when you input an invalid Command.
CommandNameAlreadyExists
Is raised when you make a Command have the same name as another.
FunctionAlreadyExists
Is raised when you try to pass the same function into a different Command.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplipy-python-0.1.7.tar.gz.
File metadata
- Download URL: simplipy-python-0.1.7.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfde5d3270a41b547c50a54dd5c32443a3d19e0e34fa646ba76c8c7e35333b56
|
|
| MD5 |
fde2efc23d0be25cac759f5b39595c84
|
|
| BLAKE2b-256 |
68b59186da93d914e0e55be4b9e733430d38581fd34453eaae1913eb52db5adf
|
File details
Details for the file simplipy_python-0.1.7-py3-none-any.whl.
File metadata
- Download URL: simplipy_python-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e2e86698041e41ea8cdfe7320aee1c0e5b0204d2b321aa400fb9103d01b39d8
|
|
| MD5 |
fe3c47637182a153c045223f7540e582
|
|
| BLAKE2b-256 |
1a07f5f1d1e8de113fc0d8f5840b50e4c2858286eb42a9a3ab1cbbe2862f49aa
|