summaryrefslogtreecommitdiff
path: root/unrpyc
diff options
context:
space:
mode:
Diffstat (limited to 'unrpyc')
-rw-r--r--unrpyc/Makefile4
-rw-r--r--unrpyc/decompiler.py12
-rwxr-xr-xunrpyc/find-gzip.sh12
3 files changed, 14 insertions, 14 deletions
diff --git a/unrpyc/Makefile b/unrpyc/Makefile
index 826f1e3..829d2b9 100644
--- a/unrpyc/Makefile
+++ b/unrpyc/Makefile
@@ -13,6 +13,10 @@ script.json: $(patsubst %.rpyc,%.json,$(wildcard script-*.rpyc))
%.json: %.json.o
node fix.js $< $@
+ui-strings.json.o: ui-strings.rpyc *.py
+ python unrpyc.py --clobber $< $@
+ sed -i -e 's/ \["init_language", "en", \],//;s/^\]}$$/}/' $@
+
%.json.o: %.rpyc *.py
python unrpyc.py --clobber $< $@
diff --git a/unrpyc/decompiler.py b/unrpyc/decompiler.py
index 95aebf7..ee55ef1 100644
--- a/unrpyc/decompiler.py
+++ b/unrpyc/decompiler.py
@@ -274,14 +274,12 @@ class PrintRenPython(python_ast.NodeVisitor):
return '"%s"' % node.attr
def visit_Assign(self, node):
- if not isinstance(node.targets[0], python_ast.Subscript):
- if isinstance(node.targets[0], python_ast.Name):
- id = node.targets[0].id
- if id == 'suppress_window_after_timeskip' or id == '_window':
- return
- else:
+ if isinstance(node.targets[0], python_ast.Subscript):
return
- print(python_ast.dump(node))
+ if isinstance(node.targets[0], python_ast.Name):
+ id = node.targets[0].id
+ if id == 'suppress_window_before_timeskip' or id == 'suppress_window_after_timeskip' or id == '_window':
+ return
self.f.write(self.visit(node.targets[0]))
self.f.write(': ')
self.f.write(self.visit(node.value))
diff --git a/unrpyc/find-gzip.sh b/unrpyc/find-gzip.sh
index 2ee9064..cb65dc9 100755
--- a/unrpyc/find-gzip.sh
+++ b/unrpyc/find-gzip.sh
@@ -1,13 +1,11 @@
#!/bin/sh
-ZOPFLI="$(command -v zopfli)"
-GZIP="$(command -v gzip)"
-if [ -n $ZOPFLI ]; then
- echo "$ZOPFLI"
-elif [ -n $GZIP ]; then
+if command -v zopfli; then
+ printf "%s" "$(command -v zopfli)"
+elif command -v gzip; then
echo >&2 "Consider obtaining zopfli (https://code.google.com/p/zopfli/)"
echo >&2 "for higher compression ratios (about 5% decrease in size of"
- echo >&2 "script.json.gz."
- echo "$GZIP -9"
+ echo >&2 "script.json.gz)."
+ printf "%s" "$(command -v gzip) -9"
else
echo >&2 "Could not find zopfli or gzip, aborting."
exit 1