python - How can I upload whole folder instead of one by one file in rackspace -
right using threading slow. looking upload folder api.
def run(self): """starts uploading thread.""" try: file_name in self.files["thumbs"]: self.transfer_rackspace(file_name, self.container_thumbs) except exception: pass try: file_name in self.files["tiles"]: self.transfer_rackspace(file_name, self.container_tiles) except exception: pass try: file_name in self.files["cube"]: self.transfer_rackspace(file_name, self.container_photo) except exception: pass try: file_name in self.files["image"]: self.transfer_rackspace(file_name, self.container_photo) except exception: pass
pyrax.settings.set('identity_type', 'rackspace') pyrax.set_credentials(config.app_config["cdn.account.name"], config.app_config["cdn.account.key"]) rack_conn = pyrax.cloudfiles rack_conn.upload_folder(folder_path, container)
Comments
Post a Comment