Skip to content

Instantly share code, notes, and snippets.

@mvanveen
Created January 31, 2012 20:22
Show Gist options
  • Save mvanveen/1712675 to your computer and use it in GitHub Desktop.
Save mvanveen/1712675 to your computer and use it in GitHub Desktop.
Download latest bottle build to your specified directory
#!/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