def process_func(src_base, out_base, codes, outfile, showasm, showast, do_verify, fqueue, rqueue): try: (tot_files, okay_files, failed_files, verify_failed_files) = (0,0,0,0) while 1: f = fqueue.get() if f == None: break (t, o, f, v) = \ main(src_base, out_base, [f], codes, outfile, showasm, showast, do_verify) tot_files += t okay_files += o failed_files += f verify_failed_files += v except (Empty, KeyboardInterrupt, OSError): pass rqueue.put((tot_files, okay_files, failed_files, verify_failed_files)) rqueue.close()
def process_func(src_base, out_base, codes, outfile, showasm, showast, do_verify, fqueue, rqueue): try: (tot_files, okay_files, failed_files, verify_failed_files) = (0, 0, 0, 0) while 1: f = fqueue.get() if f == None: break (t, o, f, v) = \ main(src_base, out_base, [f], codes, outfile, showasm, showast, do_verify) tot_files += t okay_files += o failed_files += f verify_failed_files += v except (Empty, KeyboardInterrupt, OSError): pass rqueue.put((tot_files, okay_files, failed_files, verify_failed_files)) rqueue.close()
del sb_len if outfile == '-': outfile = None # use stdout elif outfile and os.path.isdir(outfile): out_base = outfile outfile = None elif outfile and len(files) > 1: out_base = outfile outfile = None if timestamp: print time.strftime(timestampfmt) if numproc <= 1: try: result = main(src_base, out_base, files, codes, outfile, showasm, showast, do_verify) print '# decompiled %i files: %i okay, %i failed, %i verify failed' % result except (KeyboardInterrupt, OSError): pass except verify.VerifyCmpError: raise else: # create directories beforehand for f in files: try: os.makedirs(os.path.join(out_base, os.path.dirname(f))) except OSError: pass fqueue = Queue(len(files) + numproc) for f in files: fqueue.put(f)
sb_len = len( os.path.join(src_base, '') ) files = map(lambda f: f[sb_len:], files) del sb_len if outfile == '-': outfile = None # use stdout elif outfile and os.path.isdir(outfile): out_base = outfile; outfile = None elif outfile and len(files) > 1: out_base = outfile; outfile = None if timestamp: print time.strftime(timestampfmt) if numproc <= 1: try: result = main(src_base, out_base, files, codes, outfile, showasm, showast, do_verify) print '# decompiled %i files: %i okay, %i failed, %i verify failed' % result except (KeyboardInterrupt, OSError): pass except verify.VerifyCmpError: raise else: # create directories beforehand for f in files: try: os.makedirs(os.path.join(out_base, os.path.dirname(f))) except OSError: pass fqueue = Queue(len(files)+numproc) for f in files: fqueue.put(f)