Skip to content

Instantly share code, notes, and snippets.

@omz omz/install cloudfiles.py Secret
Created Oct 23, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.