-
-
Save omz/9c54a36c619261067225 to your computer and use it in GitHub Desktop.
install cloudfiles
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
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