Skip to content

Instantly share code, notes, and snippets.

@omz
Created October 23, 2012 15:52
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omz/9c54a36c619261067225 to your computer and use it in GitHub Desktop.
Save omz/9c54a36c619261067225 to your computer and use it in GitHub Desktop.
install cloudfiles
modname = 'cloudfiles'
base_url = 'https://raw.github.com/rackspace/python-cloudfiles/master/cloudfiles/'
files = ['__init__.py', 'authentication.py', 'connection.py', 'consts.py',
'container.py', 'errors.py', 'fjson.py', 'storage_object.py',
'utils.py']
import os
import requests
print 'Creating module directory:', modname
if not os.path.isdir(modname):
os.mkdir(modname)
for filename in files:
print 'Downloading', filename
url = base_url + filename
r = requests.get(url)
dest = os.path.join(modname, filename)
with open(dest, 'w') as f:
f.write(r.text)
print 'Done.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment