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

Method prettyPrint

pager_lib/pyasn1/type/univ.py:2724–2744  ·  view source on GitHub ↗

Return an object representation string. Returns ------- : :class:`str` Human-friendly object representation.

(self, scope=0)

Source from the content-addressed store, hash-verified

2722 return False
2723
2724 def prettyPrint(self, scope=0):
2725 """Return an object representation string.
2726
2727 Returns
2728 -------
2729 : :class:`str`
2730 Human-friendly object representation.
2731 """
2732 scope += 1
2733 representation = self.__class__.__name__ + ':\n'
2734 for idx, componentValue in enumerate(self._componentValues):
2735 if componentValue is not noValue and componentValue.isValue:
2736 representation += ' ' * scope
2737 if self.componentType:
2738 representation += self.componentType.getNameByPosition(idx)
2739 else:
2740 representation += self._dynamicNames.getNameByPosition(idx)
2741 representation = '%s=%s\n' % (
2742 representation, componentValue.prettyPrint(scope)
2743 )
2744 return representation
2745
2746 def prettyPrintType(self, scope=0):
2747 scope += 1

Callers

nothing calls this directly

Calls 2

getNameByPositionMethod · 0.45
prettyPrintMethod · 0.45

Tested by

no test coverage detected