本文整理汇总了Python中pyndn.name.Name.getPrefix方法的典型用法代码示例。如果您正苦于以下问题:Python Name.getPrefix方法的具体用法?Python Name.getPrefix怎么用?Python Name.getPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyndn.name.Name
的用法示例。
在下文中一共展示了Name.getPrefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyndn.name import Name [as 别名]
# 或者: from pyndn.name.Name import getPrefix [as 别名]
def __init__(self, prefix, dataType, face, keyChain, database, repeatAttempts=None, keyRetrievalLink=None):
self._face = face
self._keyChain = keyChain
self._database = database
self._maxRepeatAttempts = 3 if repeatAttempts == None else repeatAttempts
self._keyRetrievalLink = Producer.NO_LINK if keyRetrievalLink == None else Link(keyRetrievalLink)
# The dictionary key is the key Name The value is a Producer._KeyInfo.
self._eKeyInfo = {}
# The dictionary key is the float time stamp. The value is a Producer._KeyRequest.
self._keyRequests = {}
fixedPrefix = Name(prefix)
fixedDataType = Name(dataType)
# Fill _ekeyInfo with all permutations of dataType, including the 'E-KEY'
# component of the name. This will be used in createContentKey to send
# interests without reconstructing names every time.
fixedPrefix.append(Encryptor.NAME_COMPONENT_READ)
while fixedDataType.size() > 0:
nodeName = Name(fixedPrefix)
nodeName.append(fixedDataType)
nodeName.append(Encryptor.NAME_COMPONENT_E_KEY)
self._eKeyInfo[nodeName] = Producer._KeyInfo()
fixedDataType = fixedDataType.getPrefix(-1)
fixedPrefix.append(dataType)
self._namespace = Name(prefix)
self._namespace.append(Encryptor.NAME_COMPONENT_SAMPLE)
self._namespace.append(dataType)