mac-agents的Python项目详细描述
安装
$ [sudo] pip install mac-agents
类
class | ^{} |
---|
^{} | launchd.plist generator. Capital letter attrs/props as launchd.plist keys |
函数
function | ^{} |
---|
^{} | return a list of launchctl Job objects (^{}, ^{}, ^{}) |
^{} | return a dictionary with plist file data |
^{} | update plist file data |
^{} | write data dictionary to a plist file |
可执行模块
usage | ^{} |
---|
^{} | generate launchd.plist from python file(s) |
^{} | set Finder tags. ^{} - status, ^{} - stderr, ^{} - unloaded |
示例
~/Library/LaunchAgents/file.py
importmac_agentsclassAgent(mac_agents.Agent):StartInterval=5# capital letterdefrun(self):passif__name__=="__main__":Agent().run()
$ find ~/Library/LaunchAgents -name "*.py"| xargs python -m mac_agents.create "$@"
$ find ~/Library/LaunchAgents -name "*.plist"| xargs launchctl load # or launchctl unload
$ launchctl list | grep .py$ | awk '{print $3}'| xargs -I '{}' launchctl remove {}
$ find ~/Library/LaunchAgents -name "*.py.plist" -exec rm {} +
链接
python-readme-generator
欢迎加入QQ群-->: 979659372
推荐PyPI第三方库