Metadata-Version: 2.1
Name: django-launchd
Version: 2019.3.4
Summary: launchd.plist model
Home-page: https://github.com/looking-for-a-job/django-launchd.py
License: UNKNOWN
Keywords: launchd
Platform: UNKNOWN
Classifier: Framework :: Django
Classifier: License :: Public Domain
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development
Description-Content-Type: text/markdown
Requires-Dist: Django
Requires-Dist: public
Requires-Dist: setuptools

[![](https://img.shields.io/pypi/pyversions/django-launchd.svg?longCache=True)](https://pypi.org/project/django-launchd/)

#### Install
```bash
$ [sudo] pip install django-launchd
```

#### Examples
init
```python
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
```python
for agent in filter(lambda a: a.exists, Plist.objects.all()):
    if <condition>:
        agent.lock("key")
    else:
        agent.unlock("key")
```

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

<p align="center"><a href="https://pypi.org/project/readme-md/">readme-md</a> - README.md generator</p>

