import object_storage
sl_storage = object_storage.get_client("SLOSxxxxx-2:SLxxxx", "my_api_key", datacenter="dal05")
sl_storage.containers()
# []
sl_storage['foo'].create()
# Container(foo)
sl_storage.containers()
# [Container(foo)]
sl_storage['foo'].properties
# {'count': 0, 'object_count': 0, 'name': 'foo', 'size': 0.0}
sl_storage['foo']['bar.txt'].create()
# StorageObject(foo, sample_object.txt)
sl_storage['foo']['bar.txt'].send('Plain-Text Content')
# True
sl_storage['foo']['bar.txt'].read()
# 'Plain-Text Content'
sl_storage['foo'].objects()
# [StorageObject(foo, bar.txt)]
sl_storage['foo']['bar.txt'].delete()
# True
sl_storage['foo'].delete()
# True
它返回以下错误:
回溯(最近通话最近):
实例化抽象类ContainerModel
的文件“ object.py”,第11行 sl_storage.containers()
文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/client.py”,第293行,位于容器中 formatter = _formatter)
在make_request中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/client.py”,第354行
结果= self.conn.make_request(方法,网址,* args,** kwargs)
在make_request中,文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/transport/httplib2conn.py”第66行
返回格式化程序(响应)
文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/client.py”,第288行,以_formatter
container.append(self.container(name,item))
容器中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/client.py”,第221行,
返回self.container_class(name,headers = headers,client = self)
init
中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/object_storage/container.py”第71行 self.model = ContainerModel(self,self.name,标头)
TypeError:无法使用抽象方法 iter , len
可能是什么原因造成的?