Created
June 2, 2010 03:42
-
-
Save batok/421902 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from boto.gs.connection import GSConnection | |
def main(upload = False): | |
c = GSConnection() | |
for bucket in c.get_all_buckets(): | |
print "Bucket ... ", bucket.name | |
for key in bucket.get_all_keys(): | |
print key.name | |
if upload: | |
key = bucket.new_key("testboto.py") | |
with open("testboto2.py","rb") as f: | |
key.set_contents_from_file(f,policy="private") | |
if __name__ == "__main__": | |
main(True) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a shorter version as a result of the tip from Mitch Garnaat