Printer with indentation support.
| 1145 | |
| 1146 | |
| 1147 | class Printer(object): |
| 1148 | """Printer with indentation support.""" |
| 1149 | |
| 1150 | def __init__(self): |
| 1151 | self.indent = 0 |
| 1152 | |
| 1153 | def Indent(self): |
| 1154 | self.indent += 2 |
| 1155 | |
| 1156 | def Dedent(self): |
| 1157 | self.indent -= 2 |
| 1158 | |
| 1159 | def Print(self, string): |
| 1160 | print("%s%s" % (self._IndentString(), string)) |
| 1161 | |
| 1162 | def PrintLines(self, lines): |
| 1163 | indent = self._IndentString() |
| 1164 | print("\n".join("%s%s" % (indent, line) for line in lines)) |
| 1165 | |
| 1166 | def _IndentString(self): |
| 1167 | return self.indent * " " |
| 1168 | |
| 1169 | |
| 1170 | ADDRESS_RE = re.compile(r"0x[0-9a-fA-F]+") |
no outgoing calls
no test coverage detected
searching dependent graphs…