# and bandwidth usage. So, override this method and use the
# Cloudfile's "send" interface instead.
# TODO: Fixing write() still seems worthwhile though.
+ _log.debug('Sending {0} to cloudfiles...'.format(filepath))
with self.get_file(filepath, 'wb') as dest_file:
with file(filename, 'rb') as source_file:
# Copy to storage system in 4096 byte chunks
Currently this method does not support any write modes except "append".
However if we should need it it would be easy implement.
"""
+ _log.warn(
+ '{0}.write() has bad performance! Use .send instead for now'\
+ .format(self.__class__.__name__))
+
if self.storage_object.size and type(data) == str:
_log.debug('{0} is > 0 in size, appending data'.format(
self.storage_object.name))
self.storage_object.name))
self.storage_object.write(data, *args, **kwargs)
+ def send(self, *args, **kw):
+ self.storage_object.send(*args, **kw)
+
def close(self):
"""
- Not implemented.
+ Not sure we need anything here.
"""
pass