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

Method getName

pager_lib/pyasn1/type/univ.py:3168–3183  ·  view source on GitHub ↗

Return the name of currently assigned component of the |ASN.1| object. Returns ------- : :py:class:`str` |ASN.1| component name

(self, innerFlag=False)

Source from the content-addressed store, hash-verified

3166 return c
3167
3168 def getName(self, innerFlag=False):
3169 """Return the name of currently assigned component of the |ASN.1| object.
3170
3171 Returns
3172 -------
3173 : :py:class:`str`
3174 |ASN.1| component name
3175 """
3176 if self._currentIdx is None:
3177 raise error.PyAsn1Error('Component not chosen')
3178 else:
3179 if innerFlag:
3180 c = self._componentValues[self._currentIdx]
3181 if isinstance(c, Choice):
3182 return c.getName(innerFlag)
3183 return self.componentType.getNameByPosition(self._currentIdx)
3184
3185 @property
3186 def isValue(self):

Callers 4

__contains__Method · 0.45
__iter__Method · 0.45
keysMethod · 0.45
itemsMethod · 0.45

Calls 1

getNameByPositionMethod · 0.45

Tested by

no test coverage detected