From a1bdc1283d2464bff2bc725988b2fdc74b34ef74 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 21 Aug 2013 11:13:11 -0400 Subject: work on i18n --- unrpyc/decompiler.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/unrpyc/decompiler.py b/unrpyc/decompiler.py index 9180098..95aebf7 100644 --- a/unrpyc/decompiler.py +++ b/unrpyc/decompiler.py @@ -275,10 +275,17 @@ class PrintRenPython(python_ast.NodeVisitor): def visit_Assign(self, node): if not isinstance(node.targets[0], python_ast.Subscript): - self.f.write(self.visit(node.targets[0])) - self.f.write(': ') - self.f.write(self.visit(node.value)) - self.f.write(',\n') + if isinstance(node.targets[0], python_ast.Name): + id = node.targets[0].id + if id == 'suppress_window_after_timeskip' or id == '_window': + return + else: + return + print(python_ast.dump(node)) + self.f.write(self.visit(node.targets[0])) + self.f.write(': ') + self.f.write(self.visit(node.value)) + self.f.write(',\n') def visit_Call(self, node): self.f.write('[') @@ -327,10 +334,6 @@ class PrintRenPython(python_ast.NodeVisitor): def visit_keyword(self, node): return self.visit(node.value) - def visit(self, node): - self.f.write(python_ast.dump(node)) - return super().visit(node) - def print_Python(f, stmt, indent_level, early=False): code_src = stmt.code.source -- cgit v1.2.3-70-g09d2