Skip to main content

LaunchAgents + python

Project description

Installation

$ [sudo] pip install mac-agents

Examples

~/Library/LaunchAgents/file.py

import mac_agents

class Agent(mac_agents.Agent):
    StartInterval = 5  # capital letter

    def run(self):
        pass

if __name__ == "__main__":
    Agent().run()
$ find ~/Library/LaunchAgents -name "*.py" | xargs python -m mac_agents.create "$@"
$ find ~/Library/LaunchAgents -name "*.plist" | xargs launchctl load # or launchctl unload
$ launchctl list | grep .py$ | awk '{print $3}' | xargs -I '{}' launchctl remove {}
$ find ~/Library/LaunchAgents -name "*.py.plist" -exec rm {} +

Links

readme42.com

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

mac-agents-2020.7.2.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file mac-agents-2020.7.2.tar.gz.

File metadata

  • Download URL: mac-agents-2020.7.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.7

File hashes

Hashes for mac-agents-2020.7.2.tar.gz
Algorithm Hash digest
SHA256 952fab26d73b1991c07def5eb40bdafed611fe181874601a8cee5f40b48ccb33
MD5 09f415ab4ec671cf16888e9d2017bb8d
BLAKE2b-256 d96e36ba3f9414965964c9321ad9eeabcd3df98876d5f8feb06c270f1419b625

See more details on using hashes here.

Supported by

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