Skip to main content

launchd.plist model

Project description

Installation

$ [sudo] pip install django-launchd

settings.py

INSTALLED_APPS = [
    "django_launchd",
]

Models

model __doc__
django_launchd.models.Plist launchd.plist model. fields: path
django_launchd.models.Lock launchd.plist Lock class. fields: plist (ForeignKey), key

Examples

init

import django_launchd
from django_launchd.models import Plist

files = django_launchd.files("~/Library/LaunchAgents")
for f in files:
    Plist.objects.get_or_create(path=f)
Plist.objects.exclude(path__in=files).delete()

locks

for agent in filter(lambda a: a.exists, Plist.objects.all()):
    if <condition>:
        agent.lock("key")
    else:
        agent.unlock("key")

load/unload

for agent in filter(lambda a: a.exists, Plist.objects.all()):
    if agent.locks:
        agent.unload()
    else:
        agent.load()

django-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 django-launchd, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size django-launchd-2019.4.13.tar.gz (2.9 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