def _handle(self, *args, **options): conn = Connection(options['username'], options['api_key']) container = conn.get_container(options['container_name']) print "Downloading files from '%s':" % container.name start_time = time.time() count, bytes = Container.download(container, options['local_root'], force=options['force'], prefix=options['prefix'], verbosity=options['verbosity']) stats = count, format_bytes(bytes), format_secs(time.time()-start_time) print "Finished downloading %u files (%s) in %s." % stats
def _handle(self, *args, **options): conn = Connection(options["username"], options["api_key"]) container = conn.get_container(options["container_name"], options["create_container"]) print "Uploading files from '%s':" % options["local_root"] start_time = time.time() count, bytes = Container.upload_tree( container, options["local_root"], force=options["force"], verbosity=options["verbosity"] ) stats = count, format_bytes(bytes), format_secs(time.time() - start_time) print "Finished uploading %u files (%s) in %s." % stats if Container.check_public(container, options["make_public"]): Container.check_uri(container, getattr(settings, "MEDIA_URL", None))