MCPcopy
hub / github.com/rocky/python-uncompyle6 / traverse

Method traverse

uncompyle6/semantics/pysource.py:458–476  ·  view source on GitHub ↗
(self, node, indent=None, is_lambda=False)

Source from the content-addressed store, hash-verified

456 self.indent = self.indent[: -len(indent)]
457
458 def traverse(self, node, indent=None, is_lambda=False):
459 self.param_stack.append(self.params)
460 if indent is None:
461 indent = self.indent
462 p = self.pending_newlines
463 self.pending_newlines = 0
464 self.params = {
465 "_globals": {},
466 "_nonlocals": {}, # Python 3 has nonlocal
467 "f": StringIO(),
468 "indent": indent,
469 "is_lambda": is_lambda,
470 }
471 self.preorder(node)
472 self.f.write("\n" * self.pending_newlines)
473 result = self.f.getvalue()
474 self.params = self.param_stack.pop()
475 self.pending_newlines = p
476 return result
477
478 def write(self, *data):
479 if (len(data) == 0) or (len(data) == 1 and data[0] == ""):

Callers 15

print_super_classesMethod · 0.95
print_super_classes3Method · 0.95
kv_mapMethod · 0.95
get_tuple_parameterMethod · 0.95
build_classMethod · 0.95
gen_sourceMethod · 0.95
format_pos_argsFunction · 0.45
call36_tupleFunction · 0.45
call36_dictFunction · 0.45
n_formatted_value1Function · 0.45
n_formatted_value2Function · 0.45
n_joined_strFunction · 0.45

Calls 4

preorderMethod · 0.95
StringIOClass · 0.85
appendMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected