def storage_uri_for_key(key):
 if (not isinstance(key, boto.s3.key.Key)):
  raise InvalidUriError(('Requested key (%s) is not a subclass of boto.s3.key.Key' % str(type(key))))
 prov_name = key.bucket.connection.provider.get_provider_name()
 uri_str = ('%s://%s/%s' % (prov_name, key.bucket.name, key.name))
 return storage_uri(uri_str)

def storage_uri_for_key ( key ) : if ( not isinstance ( key , boto . s3 . key . Key ) ) : raise InvalidUriError ( ( 'Requested key (%s) is not a subclass of boto.s3.key.Key' % str ( type ( key ) ) ) ) prov_name = key . bucket . connection . provider . get_provider_name ( ) uri_str = ( '%s://%s/%s' % ( prov_name , key . bucket . name , key . name ) ) return storage_uri ( uri_str )
returns a storageuri for the given key .