libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r1081242 - in /incubator/libcloud/trunk/libcloud/storage: base.py drivers/cloudfiles.py drivers/dummy.py
Date Mon, 14 Mar 2011 00:32:17 GMT
Author: pquerna
Date: Mon Mar 14 00:32:17 2011
New Revision: 1081242

URL: http://svn.apache.org/viewvc?rev=1081242&view=rev
Log:
Rename object_as_stream to download_object_as_stream

Modified:
    incubator/libcloud/trunk/libcloud/storage/base.py
    incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
    incubator/libcloud/trunk/libcloud/storage/drivers/dummy.py

Modified: incubator/libcloud/trunk/libcloud/storage/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/base.py?rev=1081242&r1=1081241&r2=1081242&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/base.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/base.py Mon Mar 14 00:32:17 2011
@@ -72,7 +72,7 @@ class Object(object):
                                            delete_on_failure)
 
     def as_stream(self, chunk_size=None):
-        return self.driver.object_as_stream(self, chunk_size)
+        return self.driver.download_object_as_stream(self, chunk_size)
 
     def delete(self):
         return self.driver.delete_object(self)
@@ -119,8 +119,8 @@ class Container(object):
                         delete_on_failure=True):
         return self.driver.download_object(obj, destination_path)
 
-    def object_as_stream(self, obj, chunk_size=None):
-        return self.driver.object_as_stream(obj, chunk_size)
+    def download_object_as_stream(self, obj, chunk_size=None):
+        return self.driver.download_object_as_stream(obj, chunk_size)
 
     def delete_object(self, obj):
         return self.driver.delete_object(obj)
@@ -239,7 +239,7 @@ class StorageDriver(object):
         raise NotImplementedError, \
             'download_object not implemented for this driver'
 
-    def object_as_stream(self, obj, chunk_size=None):
+    def download_object_as_stream(self, obj, chunk_size=None):
         """
         Return a generator which yields object data.
 
@@ -250,7 +250,7 @@ class StorageDriver(object):
         @param chunk_size: Optional chunk size (in bytes).
         """
         raise NotImplementedError, \
-            'object_as_stream not implemented for this driver'
+            'download_object_as_stream not implemented for this driver'
 
     def upload_object(self, file_path, container, object_name, extra=None,
                       file_hash=None):

Modified: incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py?rev=1081242&r1=1081241&r2=1081242&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/drivers/cloudfiles.py Mon Mar 14 00:32:17 2011
@@ -298,7 +298,7 @@ class CloudFilesStorageDriver(StorageDri
                                  'overwrite_existing': overwrite_existing,
                                  'delete_on_failure': delete_on_failure})
 
-    def object_as_stream(self, obj, chunk_size=None):
+    def download_object_as_stream(self, obj, chunk_size=None):
         return self._get_object(obj, self._get_object_as_stream,
                                 {'chunk_size': chunk_size})
 

Modified: incubator/libcloud/trunk/libcloud/storage/drivers/dummy.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/drivers/dummy.py?rev=1081242&r1=1081241&r2=1081242&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/drivers/dummy.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/drivers/dummy.py Mon Mar 14 00:32:17 2011
@@ -248,12 +248,12 @@ class DummyStorageDriver(StorageDriver):
 
       return self._save_object(**kwargs_dict)
 
-    def object_as_stream(self, obj, chunk_size=None):
+    def download_object_as_stream(self, obj, chunk_size=None):
         """
         >>> driver = DummyStorageDriver('key', 'secret')
         >>> container = driver.create_container(container_name='test container 1')
#doctest: +IGNORE_EXCEPTION_DETAIL
         >>> obj = container.upload_object_via_stream(object_name='test object',
iterator=DummyFileObject(5, 10), extra={})
-        >>> stream = container.object_as_stream(obj)
+        >>> stream = container.download_object_as_stream(obj)
         >>> stream #doctest: +ELLIPSIS
         <closed file '<uninitialized file>', mode '<uninitialized file>' at
0x...>
         """



Mime
View raw message