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

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.

Source Distribution

launchd-plist-2019.3.22.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

launchd_plist-2019.3.22-py2.py3-none-any.whl (75.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page