nonebot-plugins-watch
hot plug and remove nonebot plugins
Installation
pip install nbplugins-watch
To validate installation
python -c "import nbplugins_watch; print(nbplugins_watch.__version__)"
0.0.6
Usage
Make a directory somewhere and place an empty __init__.py and a plugin file in it.
Monitor the directory in your nonebot runner file, e.g. in my_nonebot.py:
import nonebot
from nbplugins_watch import nbplugins_watch
nonebot.load_builtin_plugins() # optional
nonebot.load_builtin_plugins("mature-plugin-dir")
plugin_dir_path = r"path_to_plugin_dir" # absolute or relative path
nbplugins_watch(plugin_dir_path)
# turn debug on to see what's going on
# nbplugins_watch(plugin_dir_path, debug=True)
nonebot.run()
Create a file, say fancy_plugin.py if not already there, in the directory above. Edit and test and/or remove the file fancy_plugin.py to your heart's content.
Note: if a plugin file contains syntax errors (as opposed to logic errors), you'll have to restart nonebot, in other words, nbplugins_watch will cease to work after an uncaught error. nbplugins_watch can recover from syntax errors, in other words, even when a plugin file contains syntax errors (as opposed to logic errors), it just still works.
Acknowledgments
- Thanks to everyone whose code was used
Metadata
Release files for nbplugins-watch 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nbplugins-watch-0.0.6.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nbplugins_watch-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / nbplugins-watch-0.0.6.tar.gz
| Download URL | nbplugins-watch-0.0.6.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f16579188d1b65a4a20cc5cc03cb7265d7c6b68bc24ae63186333a0d4c765cfc
|
|
BLAKE2b-256 checksum How to use checksums |
8ee6cd6c253c205fccee3ed367f5282eeb73d3bb353a22f021ca333d3b65f0c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.6.7
|
Release files / nbplugins_watch-0.0.6-py3-none-any.whl
| Download URL | nbplugins_watch-0.0.6-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3856a0c6c4bd49046a9e843ddba6b1a299c6d27fd470f521e410489f991fb5a4
|
|
BLAKE2b-256 checksum How to use checksums |
e5ebece2f36435509a41aeaf841a39b669b9029935fbcd2f2cb4d9a9dd136e4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.6.7
|