From 8e883a46948e25787ecb01c0fceeee0d2e252521 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Tue, 23 Jul 2013 17:25:54 -0400 Subject: working, fixing bugs... --- unrpyc/Makefile | 6 ++++-- unrpyc/README | 2 +- unrpyc/decompiler.py | 8 +++++++- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'unrpyc') diff --git a/unrpyc/Makefile b/unrpyc/Makefile index 86dcac3..6a94ca6 100644 --- a/unrpyc/Makefile +++ b/unrpyc/Makefile @@ -12,5 +12,7 @@ clean: test: all jshint --show-non-errors *.json -.PHONY: all clean test -.PRECIOUS: %.json.o +install: all + install -t ../www/scripts *.json + +.PHONY: all clean test install diff --git a/unrpyc/README b/unrpyc/README index c046fe8..8d68bac 100644 --- a/unrpyc/README +++ b/unrpyc/README @@ -8,7 +8,7 @@ How to use: 2. Execute "2to3 -w renpy/*.py". 3. Put the rpyc files from the official KS distribution in here. 4. Run "make" with appropriate -j options (yay auto-parallelization) -5. Copy the resulting .json files to /www/scripts. +5. Run "make install". If you want to hack on the code, have fun. This is all the documentation you get. diff --git a/unrpyc/decompiler.py b/unrpyc/decompiler.py index c6046f6..64d0e4c 100644 --- a/unrpyc/decompiler.py +++ b/unrpyc/decompiler.py @@ -21,6 +21,7 @@ import ast as python_ast import renpy.ast as ast import renpy.atl as atl +import code DECOMPILE_SCREENS = False firstLabel = True @@ -176,7 +177,7 @@ def print_imspec(f, imspec): # at if len(imspec[3]) > 0: - f.write(' at ') + f.write('", "') delim = '' for s in imspec[3]: f.write(delim + escape_string(s)) @@ -275,6 +276,8 @@ class PrintRenPython(python_ast.NodeVisitor): self.f.write(self.visit(node.func)) self.f.write(', ') self.f.write(', '.join(map(self.visit, node.args))) + self.f.write(', ') + self.f.write(', '.join(map(self.visit, node.keywords))) self.f.write('],\n') def quote(self, string): @@ -292,6 +295,9 @@ class PrintRenPython(python_ast.NodeVisitor): def visit_Str(self, node): return self.quote(escape_string(node.s)) + def visit_keyword(self, node): + return self.visit(node.value) + def print_Python(f, stmt, indent_level, early=False): code_src = stmt.code.source -- cgit v1.2.3-70-g09d2