-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev: translation refactoring #226
base: dev
Are you sure you want to change the base?
Conversation
- more separation of translation and pure decompile/astdump code in unrpyc.py - TL needs now only one argparse option as the switch of both needed steps is internal - multiprocessing related code was separated to own function for easy access from all use cases - Some code for AST capture has also been separated for ease of use and so that TL can now use deobfuscation
I've pulled it into a |
No. Extracting translations from /home/olli/.xlib/RPG/_test/TheInn-1.01.01-pc/game/1_01_01/take_me_home_country_roads_images.rpyc...
Traceback (most recent call last):
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 550, in <module>
main()
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 487, in main
results = run_workers(worker_tl, args, worklist, args.processes)
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 265, in run_workers
for result in pool.imap(worker, worker_args, 1):
File "/usr/lib/python3.10/multiprocessing/pool.py", line 873, in next
raise value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<__main__.Context object at 0x76e8f63bc3d0>'. Reason: 'PicklingError("Can't pickle <class 'renpy.ast.Say'>: it's not the same object as renpy.ast.Say")' AFAIK this happens because you removed the pickling of the extracted dialogues in Step1 (i comment there also). This TL setup has quit a few traps build in i'd say. |
…the same codepath, logging of issues encountered while extracting translations, and general clarification of code.
I'll fix that (and add a comment to note why it is needed). What other traps do you mean though? |
Fixed. |
Actually don't mind that I didn't fix it for sending it to the workers again. Damnit multiprocessing. |
But wait, that actually wasn't an issue before. Passing it back to the workers always happened unpickled. I'm somewhat confused how this was working to begin with. I'll take a better look later. |
I played with TL all through Feb-Mar to get it less cumbersome(imo).
Yes. Its the "dialogue" passing out of MP which needs to be masked somehow so the pickler doesn't throw a tantrum. Maybe its just the way these data are stored inside "dialogue" and not the content. No idea really. |
…the same codepath, logging of issues encountered while extracting translations, and general clarification of code.
Aight, did a final pass over it and tested it, I was able to decompile the tutorial game in a variety of languages now. Looking through the README changes now. |
Also pushed README changes. |
This closes #202 and partly #211.
So, look what you think.
TL is now as much separated or compartmentalized as possible i think. It could be be cut out without touching much of the other code. I pulled some of the old code into dedicated functions to prevent repeat and as bonus deobfuscation is possible with TL.
Please check also the readme addition if you want to add something(dump opts...) or reword. My EN isn't the best.