Skip to main content

launchd.plist class

Project description

Installation

$ [sudo] pip install launchd-plist

Features

  • Capitalized attrs and properties identified as launchd.plist keys (custom keys also supported)

Classes

class __doc__
launchd_plist.Plist launchd.plist class

Functions

function __doc__
launchd_plist.read(path) return a dictionary with a plist file data
launchd_plist.update(path, **kwargs) update a plist file
launchd_plist.write(path, data) write a dictionary to a plist file

Examples

>>> class MyPlist(launchd_plist.Plist):
    Label = "MyPlist"
    StartInterval = 1
    Custom_key = "works"

    @property
    def StandardErrorPath(self):
        return os.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">
<plist version="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>

Related projects

Links

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for launchd-plist, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size launchd-plist-2019.4.13.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page