launchd.plist类
launchd-plist的Python项目详细描述
安装
$ [sudo] pip install launchd-plist
功能
- 大写属性和标识为launchd.plist键的属性(也支持自定义键)
类
- 大写属性和标识为launchd.plist键的属性(也支持自定义键)
类
class | ^{ |
---|---|
^{ | launchd.plist class |
函数
function | ^{ |
---|---|
^{ | return a dictionary with a plist file data |
^{ | update a plist file |
^{ | write a dictionary to a plist file |
示例
>>>classMyPlist(launchd_plist.Plist):Label="MyPlist"StartInterval=1Custom_key="works"@propertydefStandardErrorPath(self):returnos.path.expanduser("~/Logs/LaunchAgents/%s/err.log"%self.Label)>>>MyPlist().create('launchd.plist')
launchd.plist
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plistversion="1.0"><dict><key>Custom_key</key><string>works for Capitalized keys!</string><key>Label</key><string>MyPlist</string><key>StandardErrorPath</key><string>/Users/russianidiot/Logs/LaunchAgents/MyPlist/err.log</string><key>StartInterval</key><integer>1</integer></dict></plist>