pprint(context) # Copy all files for filename, filepath in template.files(): print filename print filepath dest_name = "%s %s" % (basename, filename) destination = os.path.join(destination_path, dest_name) write_file(filepath, context, destination) if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() if len(sys.argv)>1: video_file_path = sys.argv[1] else: video_file_path = select_sourcefile(cfg) if not os.path.isfile(video_file_path): print "Error: File '%s' doesn't exist!" % video_file_path sys.exit() template = select_template(cfg, video_file_path) print "Template:" pprint(template)
part = part.strip() if part: if startendswith(part, "endswith", ("bits", "kbps", "khz")): continue if startendswith(part, "startswith", ("DTS", "TrueHD")): continue parts.append(part) parts1.append(", ".join(parts)) parts1 += [p.strip(" -") for p in parameters] basename = " - ".join(parts1) return basename + ".ac3" if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() files = sys.argv[1:] if not files: files = askopenfilename2( title = "Choose the source file(s):", initialdir = cfg["last sourcedir"], multiple = True # filetypes = [('M2TS File','*.*')], ) assert isinstance(files, list) if PARAM_KEY not in cfg: cfg[PARAM_KEY] = ["-384, -down6"]
log = file(log_abs_path, "a") cmd = [cfg["eac3to"], selected_mpls.abs_path] cmd += stream_cmd log.write("run %r...\n" % cmd) print cmd process = subprocess.Popen(cmd, shell=True) process.wait() log.close() if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() cfg.ask_out_dir() try_path = None if len(sys.argv) >= 2: filepath = sys.argv[1] if not "BDMV" in filepath: print "Ignore DROP path: %r" % filepath print "Info: DROP e.g.: '.../BDMV/index.bdmv' file..." else: try_path = filepath.split("BDMV")[0] #FIXME ;) # Get a instance from the class BD_objects.BD() bluray = BD_objects.get_disc(cfg, try_path) bluray.edit_movie_name()
""" from shared.tk_tools import simple_input from shared.config import VideoToolsConfig, DEFAULT_CONFIG def set_size(cfg, key): txt = key.replace("_", " ") raw_skip_size = simple_input( title="Setup m2ts file %s:" % txt, pre_lable="m2ts file %s:" % txt, init_value=cfg[key], post_lable="(in Bytes)", ) cfg[key] = int(raw_skip_size) if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() cfg["videofiletypes"] = DEFAULT_CONFIG["videofiletypes"] if cfg.out_dir_set == False: # No new config file created, and out dir requested in the past cfg.ask_out_dir() set_size(cfg, "skip_size") set_size(cfg, "ignore_size") cfg.save_config() cfg.debug()
cmd = [cfg["eac3to"], selected_mpls.abs_path] cmd += stream_cmd log.write("run %r...\n" % cmd) print cmd process = subprocess.Popen(cmd, shell=True) process.wait() log.close() if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() cfg.ask_out_dir() try_path = None if len(sys.argv)>=2: filepath = sys.argv[1] if not "BDMV" in filepath: print "Ignore DROP path: %r" % filepath print "Info: DROP e.g.: '.../BDMV/index.bdmv' file..." else: try_path = filepath.split("BDMV")[0] #FIXME ;) # Get a instance from the class BD_objects.BD() bluray = BD_objects.get_disc(cfg, try_path) bluray.edit_movie_name()
part = part.strip() if part: if startendswith(part, "endswith", ("bits", "kbps", "khz")): continue if startendswith(part, "startswith", ("DTS", "TrueHD")): continue parts.append(part) parts1.append(", ".join(parts)) parts1 += [p.strip(" -") for p in parameters] basename = " - ".join(parts1) return basename + ".ac3" if __name__ == "__main__": cfg = VideoToolsConfig() cfg.debug() files = sys.argv[1:] if not files: files = askopenfilename2( title="Choose the source file(s):", initialdir=cfg["last sourcedir"], multiple=True # filetypes = [('M2TS File','*.*')], ) assert isinstance(files, list) if PARAM_KEY not in cfg: cfg[PARAM_KEY] = ["-384, -down6"]