Created
January 31, 2012 20:22
-
-
Save mvanveen/1712675 to your computer and use it in GitHub Desktop.
Download latest bottle build to your specified directory
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
#!/usr/bin/env python | |
"""Downloads the most recent bottle build from gitub in a specified directory | |
""" | |
import os | |
import sys | |
import urllib2 | |
bottle_url = 'https://github.com/defnull/bottle/raw/master/bottle.py' | |
assert len(sys.argv) == 2, 'Wrong number of args' | |
print 'getting_bottle...', | |
bottle = urllib2.urlopen(bottle_url).read() | |
print 'OK' | |
print 'writing file...', | |
with open (os.path.join(sys.argv[1], 'bottle.py'), 'w+') as file_obj: | |
file_obj.write(bottle) | |
print 'OK.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment