Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 2.12 KB

README.md

File metadata and controls

65 lines (43 loc) · 2.12 KB

weeplug

A collection of WeeChat Python scripts.

To make writing these scripts easier, weeplug provides the plumbing and helpers to write them in an object-oriented style, and hides the gory (C) details of the Python plugin as far as possible, like manual memory management and so-called ‘pointers’. weeplug also makes it easy to use a Python virtualenv, to provide your WeeChat scripts with external dependencies.

Installation

weeplug is a normal Python package and uses a standard Python project layout. The package is installed into a virtualenv dedicated to WeeChat, and then shoehorned into the Python plugin's loading mechanism by means of a shim file.

/usr/bin/virtualenv ~/.weechat/venv
~/.weechat/venv/bin/pip install -e "git+https://github.com/pyroscope/weeplug.git#egg=weeplug"

To directly use the code from a git working directory at another location, additionally call this command:

~/.weechat/venv/bin/python ./setup.py develop -U

TODO add weeplug link helper command to do this

Finally, to make the weeplug scripts available within your WeeChat configuration, symlink the shim.py file to the default script location for each script.

weeplug_base="$(dirname $(~/.weechat/venv/bin/python -c 'import weeplug; print weeplug.__file__'))"
for script in "$weeplug_base/scripts"/[^_]*.py; do
    ln -nfs "$weeplug_base/data/shim.py" ~/.weechat/python/"$(basename $script)"
done

Usage

'fluxfeed' Script

TODO

References

Related Projects

GitHub