Replies: 6 comments
-
Fair, that is probably not the most wanted behavior, although for me it was often useful while working on it (because it's a reminder you probably meant to use
Agreed. It'd be nice to have an option that just prints a lot of info for bug reports (python version, unrpyc version, file information). It'd be nice if we could get that from the rpyc file itself. Unfortunately that's a bit hard (funnily enough, rpyc files actually have a script_version field in there. But the value hasn't been changed in like 18 years. I'll have to think about the nicest way to implement that for a bit. |
Beta Was this translation helpful? Give feedback.
-
Sure. The same.
Oh right, i forgot: The header line should be cited if the fileheader not fits. We see instant what we got.
I would have volunteered to try my hand on all this, but i have no idea if this bangs with printlock, multiproc. etc. I thought also about some class for counting (shared state or so) file result. The same for all the fileinformation if not a namedtuple. |
Beta Was this translation helpful? Give feedback.
-
OK. To get around the dependence on the return values for the outcome result of decompiling, i made a global dict for counting: I did try with different methods to write to it inside the multiprocessing loops, but it did not work to sync the counter values to the base dict.
Nothing. Any idea? |
Beta Was this translation helpful? Give feedback.
-
Due to the nature of mutliprocessing, each What you want to do is just return the status as a result from the worker. Then afterwards in the main process you just process that list to figure out the total failures/successes. I'd probably handle it like this. # define special case exceptions for the special cases we're interesting in reporting differently.
# these should be raised by the relevant piece of code.
class AlreadyExists(Exception):
pass
class BrokenHeader(Exception):
pass
# return None on success. Returns the exception if something failed.
def worker(arg_tup):
try:
# code that tries to decompile a file here
return None
except Exception as e:
# print exception like it currently does
return e
# in main
if args.processes > 1 and len(worklist) > 5:
with Pool(args.processes, sharelock, [printlock]) as pool:
results = pool.map(worker, worklist)
else:
results = list(map(worker, worklist))
success = len(i for i in results if i is None)
skipped = len(i for i in results if isinstance(i, AlreadyExists)
failed = len(results) - success - skipped
# etcetera |
Beta Was this translation helpful? Give feedback.
-
What you describe and with extension on your system of return values i had already working. For the file skipping i (mis)used a Funnily i got the syncing working just before you answered above. 😵💫 Timing... I upload it by chance, so you can test it if you want and add what you want. The multiprocessing "mock" will probably need to be looked after and I'm not sure i can do it. I see a change for |
Beta Was this translation helpful? Give feedback.
-
Was already implemented with context object etc., forgotten to close. |
Beta Was this translation helpful? Give feedback.
-
Atm we get two possible outcomes after unrpyc is done: Success or fail. The thing is skipped files are counted as "failed" and that's nonsense in my book. So i would like this changed.
Counting this is so far done with booleans and this gives you just two possible answers, so we need another way. My idea is to write to a dict with three keys e.g: ok, fail, skip.
Unrpyc delivers no info about versions and users tend to omit a lot of stuff.
I think we should simply include the current unrpyc version somewhere and print it at the end in some msg out. Along with the one from RenPys
/renpy/vc_version.py
. Maybe grab even the app name out of options.py and add it.Beta Was this translation helpful? Give feedback.
All reactions