Skip to content

Instantly share code, notes, and snippets.

@batok
Created June 2, 2010 03:42
Show Gist options
  • Save batok/421902 to your computer and use it in GitHub Desktop.
Save batok/421902 to your computer and use it in GitHub Desktop.
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()
@batok
Copy link
Author

batok commented Jun 2, 2010

This is a shorter version as a result of the tip from Mitch Garnaat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment