當前位置: 首頁>>代碼示例>>Python>>正文


Python base.AbstractConstructedAsn1Item方法代碼示例

本文整理匯總了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()) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:18,代碼來源:univ.py

示例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()) 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:18,代碼來源:univ.py

示例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()) 
開發者ID:tp4a,項目名稱:teleport,代碼行數:18,代碼來源:univ.py

示例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 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:9,代碼來源:encoder.py

示例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) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:10,代碼來源:univ.py

示例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) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:7,代碼來源:univ.py

示例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) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:7,代碼來源:univ.py

示例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) 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:9,代碼來源:encoder.py

示例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) 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:7,代碼來源:univ.py

示例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 
開發者ID:tp4a,項目名稱:teleport,代碼行數:14,代碼來源:univ.py


注:本文中的pyasn1.type.base.AbstractConstructedAsn1Item方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。