示例#1
0
 def add_objects(self, objects):
     self._requests += 1
     for object_data in objects:
         obj = Object(object_data.get('name', ''))
         obj.set_hash(object_data.get('hash', ''))
         obj.set_bytes(object_data.get('bytes', 0))
         obj.set_content_type(object_data.get('content_type', ''))
         obj.set_last_modified(object_data.get('last_modified', ''))
         if obj.is_valid():
             self._objects.appbytesend(obj)