Last active
December 18, 2015 17:05
-
-
Save mheistermann/c76eea9c2ce33b64d31c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from strings import stringlist | |
import re | |
import json | |
re_stringaccess = re.compile(r"_\$_447d\[([0-9]+)\]") | |
def main(): | |
def repl(matchobj): | |
numstr = matchobj.groups()[0] | |
idx = json.loads(numstr) | |
return "'{}'".format(stringlist[idx]) | |
with open("unstringed.js","w") as outfile: | |
for line in open("jsnice.js"): | |
fixed = re_stringaccess.sub(repl, line) | |
outfile.write(fixed) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment