本文整理汇总了Python中kazoo.protocol.states.ZnodeStat._make方法的典型用法代码示例。如果您正苦于以下问题:Python ZnodeStat._make方法的具体用法?Python ZnodeStat._make怎么用?Python ZnodeStat._make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kazoo.protocol.states.ZnodeStat
的用法示例。
在下文中一共展示了ZnodeStat._make方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deserialize
# 需要导入模块: from kazoo.protocol.states import ZnodeStat [as 别名]
# 或者: from kazoo.protocol.states.ZnodeStat import _make [as 别名]
def deserialize(cls, bytes, offset):
count = int_struct.unpack_from(bytes, offset)[0]
offset += int_struct.size
if count == -1: # pragma: nocover
return []
children = []
for c in range(count):
child, offset = read_string(bytes, offset)
children.append(child)
stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
return children, stat
示例2: deserialize
# 需要导入模块: from kazoo.protocol.states import ZnodeStat [as 别名]
# 或者: from kazoo.protocol.states.ZnodeStat import _make [as 别名]
def deserialize(cls, bytes, offset):
header = MultiHeader(None, False, None)
results = []
response = None
while not header.done:
if header.type == Create.type:
response, offset = read_string(bytes, offset)
elif header.type == Delete.type:
response = True
elif header.type == SetData.type:
response = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
offset += stat_struct.size
elif header.type == CheckVersion.type:
response = True
elif header.type == -1:
err = int_struct.unpack_from(bytes, offset)[0]
offset += int_struct.size
response = EXCEPTIONS[err]()
if response:
results.append(response)
header, offset = MultiHeader.deserialize(bytes, offset)
return results