本文整理汇总了Python中pyasn1.type.base.AbstractConstructedAsn1Item方法的典型用法代码示例。如果您正苦于以下问题:Python base.AbstractConstructedAsn1Item方法的具体用法?Python base.AbstractConstructedAsn1Item怎么用?Python base.AbstractConstructedAsn1Item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasn1.type.base
的用法示例。
在下文中一共展示了base.AbstractConstructedAsn1Item方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _cloneComponentValues
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def _cloneComponentValues(self, myClone, cloneValueFlag):
try:
c = self.getComponent()
except error.PyAsn1Error:
pass
else:
if isinstance(c, Choice):
tagSet = c.getEffectiveTagSet()
else:
tagSet = c.getTagSet()
if isinstance(c, base.AbstractConstructedAsn1Item):
myClone.setComponentByType(
tagSet, c.clone(cloneValueFlag=cloneValueFlag)
)
else:
myClone.setComponentByType(tagSet, c.clone())
示例2: _cloneComponentValues
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def _cloneComponentValues(self, myClone, cloneValueFlag):
try:
c = self.getComponent()
except error.PyAsn1Error:
pass
else:
if isinstance(c, Choice):
tagSet = c.getEffectiveTagSet()
else:
tagSet = c.getTagSet()
if isinstance(c, base.AbstractConstructedAsn1Item):
myClone.setComponentByType(
tagSet, c.clone(cloneValueFlag=cloneValueFlag)
)
else:
myClone.setComponentByType(tagSet, c.clone())
示例3: _cloneComponentValues
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def _cloneComponentValues(self, myClone, cloneValueFlag):
try:
component = self.getComponent()
except error.PyAsn1Error:
pass
else:
if isinstance(component, Choice):
tagSet = component.effectiveTagSet
else:
tagSet = component.tagSet
if isinstance(component, base.AbstractConstructedAsn1Item):
myClone.setComponentByType(
tagSet, component.clone(cloneValueFlag=cloneValueFlag)
)
else:
myClone.setComponentByType(tagSet, component.clone())
示例4: encodeValue
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def encodeValue(self, encodeFun, value, defMode, maxChunkSize):
if isinstance(value, base.AbstractConstructedAsn1Item):
value = value.clone(tagSet=value.getTagSet()[:-1],
cloneValueFlag=1)
else:
value = value.clone(tagSet=value.getTagSet()[:-1])
return encodeFun(value, defMode, maxChunkSize), 1
示例5: __init__
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def __init__(self, componentType=None, tagSet=None,
subtypeSpec=None, sizeSpec=None):
if componentType is None:
componentType = self.componentType
base.AbstractConstructedAsn1Item.__init__(
self, componentType.clone(), tagSet, subtypeSpec, sizeSpec
)
self._componentTypeLen = len(self._componentType)
示例6: __getitem__
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def __getitem__(self, idx):
if isinstance(idx, str):
return self.getComponentByName(idx)
else:
return base.AbstractConstructedAsn1Item.__getitem__(self, idx)
示例7: __setitem__
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def __setitem__(self, idx, value):
if isinstance(idx, str):
self.setComponentByName(idx, value)
else:
base.AbstractConstructedAsn1Item.__setitem__(self, idx, value)
示例8: encode
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def encode(self, encodeFun, value):
if isinstance(value, base.AbstractConstructedAsn1Item):
value = value.clone(tagSet=value.getTagSet()[:-1],
cloneValueFlag=1)
else:
value = value.clone(tagSet=value.getTagSet()[:-1])
return encodeFun(value)
示例9: __getitem__
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def __getitem__(self, idx):
if octets.isStringType(idx):
return self.getComponentByName(idx)
else:
return base.AbstractConstructedAsn1Item.__getitem__(self, idx)
示例10: __init__
# 需要导入模块: from pyasn1.type import base [as 别名]
# 或者: from pyasn1.type.base import AbstractConstructedAsn1Item [as 别名]
def __init__(self, *args, **kwargs):
# support positional params for backward compatibility
if args:
for key, value in zip(('componentType', 'tagSet',
'subtypeSpec', 'sizeSpec'), args):
if key in kwargs:
raise error.PyAsn1Error('Conflicting positional and keyword params!')
kwargs['componentType'] = value
base.AbstractConstructedAsn1Item.__init__(self, **kwargs)
# Python list protocol