Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a sample launchd plist for managing Stallion on Mac OS X #37

Merged
merged 1 commit into from

2 participants

@msabramo

Adds a sample plist file and a really simple python program for substituting in the python interpreter.

Example usage:

~/dev/git-repos/stallion$ python -m stallion.write_plist > ~/Library/LaunchAgents/pyevolve.stallion.plist
~/dev/git-repos/stallion$ launchctl load -w ~/Library/LaunchAgents/pyevolve.stallion.plist
~/dev/git-repos/stallion$ pgrep -fl python
36744 /Users/marc/dev/git-repos/stallion/stallion.venv/bin/python -m stallion.main
@msabramo msabramo Add a sample launchd plist for managing Stallion on Mac OS X
```
~/dev/git-repos/stallion$ python -m stallion.write_plist > pyevolve.stallion.plist
~/dev/git-repos/stallion$ launchctl load -w pyevolve.stallion.plist
~/dev/git-repos/stallion$ pgrep -fl python
36744 /Users/marc/dev/git-repos/stallion/stallion.venv/bin/python -m stallion.main
```
305765c
@perone perone merged commit cd28459 into perone:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 29, 2012
  1. @msabramo

    Add a sample launchd plist for managing Stallion on Mac OS X

    msabramo authored
    ```
    ~/dev/git-repos/stallion$ python -m stallion.write_plist > pyevolve.stallion.plist
    ~/dev/git-repos/stallion$ launchctl load -w pyevolve.stallion.plist
    ~/dev/git-repos/stallion$ pgrep -fl python
    36744 /Users/marc/dev/git-repos/stallion/stallion.venv/bin/python -m stallion.main
    ```
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 0 deletions.
  1. +24 −0 stallion/write_plist.py
View
24 stallion/write_plist.py
@@ -0,0 +1,24 @@
+import sys
+
+plist_sample_text="""
+<?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>Label</key>
+ <string>Stallone</string>
+
+ <key>ProgramArguments</key>
+ <array>
+ <string>{python}</string>
+ <string>-m</string>
+ <string>stallion.main</string>
+ </array>
+
+ <key>RunAtLoad</key>
+ <true/>
+</dict>
+</plist>
+""".strip()
+
+sys.stdout.write(plist_sample_text.format(python=sys.executable))
Something went wrong with that request. Please try again.