def apply( pickle_fn ): model_fn = pickle_fn.split(".")[0] log_fn = model_fn+".log" log = show_state( pickle_fn, True ) loglines = open( log_fn, "w" ) loglines.write( log ); loglines.close() print log if args.dump_frags: if args.output_dir: make_dir( args.output_dir, args.overwrite ) else: args.output_dir = model_fn + "_frags" make_dir( args.output_dir, args.overwrite ) for frag in get_frags( log ): frag_fn = glob.glob(os.path.abspath( args.frags_dir )+"/"+frag) assert len( frag_fn ) == 1, "%s %s" %( frag_fn, frag ) shutil.copy( frag_fn[0], args.output_dir ) shutil.copy( log_fn, args.output_dir )
def call_show_state( arguments ): pickle_fn = arguments[0] if isEmpty( pickle_fn ): return 0 else: return show_state( pickle_fn, arguments[1] )