MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / getPositionByType

Method getPositionByType

pager_lib/pyasn1/type/namedtype.py:296–318  ·  view source on GitHub ↗

Return field position by its ASN.1 type. Parameters ---------- tagSet: :class:`~pysnmp.type.tag.TagSet` ASN.1 tag set distinguishing one ASN.1 type from others. Returns ------- : :py:class:`int` ASN.1 type position in fields s

(self, tagSet)

Source from the content-addressed store, hash-verified

294 raise error.PyAsn1Error('Type position out of range')
295
296 def getPositionByType(self, tagSet):
297 """Return field position by its ASN.1 type.
298
299 Parameters
300 ----------
301 tagSet: :class:`~pysnmp.type.tag.TagSet`
302 ASN.1 tag set distinguishing one ASN.1 type from others.
303
304 Returns
305 -------
306 : :py:class:`int`
307 ASN.1 type position in fields set
308
309 Raises
310 ------
311 ~pyasn1.error.PyAsn1Error
312 If *tagSet* is not present or ASN.1 types are not unique within callee *NamedTypes*
313 """
314 try:
315 return self.__tagToPosMap[tagSet]
316
317 except KeyError:
318 raise error.PyAsn1Error('Type %s not found' % (tagSet,))
319
320 def getNameByPosition(self, idx):
321 """Return field name by its position in fields set.

Callers 5

valueDecoderMethod · 0.80
indefLenValueDecoderMethod · 0.80
getPositionNearTypeMethod · 0.80
getComponentByTypeMethod · 0.80
setComponentByTypeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected