Created
February 13, 2011 18:29
-
-
Save themartorana/824925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, subprocess, shlex | |
def start_kicker(): | |
''' | |
Kick off Kicker and pass it our | |
sprocketize command-line argument | |
''' | |
try: | |
js_path = os.path.abspath(os.path.join(os.getcwd(), '../content/js')) | |
sprocketize = "sprocketize -C %s -I hae -I vendor hae.js > %s/sprockets.js" % ( | |
js_path, | |
js_path | |
) | |
kicker = 'kicker -e "%s" %s' % ( | |
sprocketize, | |
js_path | |
) | |
args = shlex.split(kicker) | |
p = subprocess.Popen(args) | |
return p | |
except Exception as ex: | |
print "Couldn't sprocketize" | |
print ex | |
def start_runserver(): | |
''' | |
Start Django's runserver and wait for | |
it to exit | |
''' | |
args = shlex.split('python manage.py runserver_plus') | |
p = subprocess.call(args) | |
if __name__ == '__main__': | |
''' | |
Start kicker, start the | |
runserver, and when runserver | |
is killed off, kill off | |
Kicker as well | |
''' | |
k = start_kicker() | |
r = start_runserver() | |
if k: | |
k.kill() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment