Ascetic Command Runner
Not all of our projects are using either django or another God framework. So, once we start our hobby project, would be great to put into the game some commands. For example, maybe we need for our hobby project simple command test which loads custom TestRunner, etc In this case this package maybe handy for you!
Installation
Simply run in your bash:
pip install acmdrunner
Usage
In your django like manage.py command loader, you need to trigger following:
import os
from acmdrunner import Loader
...
make all your preparations, initialize project settings, etc
...
Loader.load_from_directory(os.path.dirname(__file__))
Loader.load_from_package('rit.app')
Loader will search recursively in passed folder for folders with name management. And try to load from folders found file acr_commands.py
An example of the file acr_commands.py:
from acmdrunner.dispatcher import CommandDispatcher
command_dispatcher = CommandDispatcher()
def execute(*args):
pass
command_dispatcher.register_command('test', execute)
register_command registers specific command and handler for this command. Your commands should implement execute method. Better to inherit from BaseCommand. But as it is ascetic, you can simply pass class with execute method implemented. That’s all!
To run command, please trigger following call:
from your_package_place import command_dispatcher
command_dispatcher.execute_command(command_name, *args, **kwargs)
Real usage example
If you want to load all commands from specific namespace, you can implement following:
packages_to_traverse = ('rit.app', 'rit.core')
for package in packages_to_traverse:
Loader.load_from_package(package[0])
Loader.load_from_directory(os.path.dirname(os.getcwd()))
Metadata
Release files for acmdrunner 1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| acmdrunner-1.tar.gz | 3.7 kB | Without provenance | Details |
Release files / acmdrunner-1.tar.gz
| Download URL | acmdrunner-1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6469c3d3d7b26216d0e565fc7ffdda6aa062e0cac9087041894a85b1d2589e61
|
|
BLAKE2b-256 checksum How to use checksums |
9726df3492ed291831aa749d987d0e58e2500fa6c5cafd2bb4bfba23d34a60bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for acmdrunner 1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.