diff options
author | Filipp Lepalaan <filipp@mac.com> | 2017-01-04 11:24:16 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2017-01-04 11:24:16 +0200 |
commit | 532bc175b9016daff1a5465122bd8268072ee8f8 (patch) | |
tree | edd26bae223f9445b3b1135f81115ba0601eba5f /README.md | |
parent | dd30b337f30f226d30f6cfc533ae183b79f31844 (diff) | |
download | machammer-532bc175b9016daff1a5465122bd8268072ee8f8.tar.gz machammer-532bc175b9016daff1a5465122bd8268072ee8f8.tar.bz2 machammer-532bc175b9016daff1a5465122bd8268072ee8f8.zip |
Added hooks support
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -107,6 +107,22 @@ if __name__ == '__main__': $ python install.py install_autocad update_render_nodes ``` +### Login hooks and decorators + +`machammer` allows you to execute Python code as login hooks. Just use the `@login` decorator on your loginhook function: + + +```python +from machammer.decorators import login + +@login +def sayhello(): + import sys + import subprocess + subprocess.call(['/usr/bin/say', 'Hello ' + sys.argv[1]]) + +sayhello() +``` ### system_profiler |