def main(): """"Initialize settings (not implemented) and create main window/application.""" parser = ArgumentParser(description='OpenShot version ' + info.SETUP['version']) parser.add_argument('-l', '--lang', action='store', help='language code for interface (overrides ' 'preferences and system environment)') parser.add_argument('--list-languages', dest='list_languages', action='store_true', help='List all language ' 'codes supported by OpenShot') parser.add_argument('-V', '--version', action='store_true') parser.add_argument('remain', nargs=REMAINDER) args = parser.parse_args() # Display version and exit (if requested) if args.version: print("OpenShot version %s" % info.SETUP['version']) sys.exit() if args.list_languages: print("Supported Languages:") for lang in get_all_languages(): print(" {:>12} {}".format(lang[0], lang[1])) sys.exit() if args.lang: if args.lang in info.SUPPORTED_LANGUAGES: info.CMDLINE_LANGUAGE = args.lang else: print("Unsupported language '{}'! (See --list-languages)".format( args.lang)) sys.exit(-1) reroute_output() log.info("------------------------------------------------") log.info(" OpenShot (version %s)" % info.SETUP['version']) log.info("------------------------------------------------") # Create Qt application, pass any unprocessed arguments argv = [sys.argv[0]] for arg in args.remain: argv.append(arg) app = OpenShotApp(argv) # Run and return result sys.exit(app.run())
def main(): """"Initialize settings (not implemented) and create main window/application.""" parser = ArgumentParser(description = 'OpenShot version ' + info.SETUP['version']) parser.add_argument('-l', '--lang', action='store', help='language code for interface (overrides ' 'preferences and system environment)') parser.add_argument('--list-languages', dest='list_languages', action='store_true', help='List all language ' 'codes supported by OpenShot') parser.add_argument('-V', '--version', action='store_true') parser.add_argument('remain', nargs=REMAINDER) args = parser.parse_args() # Display version and exit (if requested) if args.version: print("OpenShot version %s" % info.SETUP['version']) sys.exit() if args.list_languages: print("Supported Languages:") for lang in get_all_languages(): print(" {:>12} {}".format(lang[0],lang[1])) sys.exit() if args.lang: if args.lang in info.SUPPORTED_LANGUAGES: info.CMDLINE_LANGUAGE = args.lang else: print("Unsupported language '{}'! (See --list-languages)".format(args.lang)) sys.exit(-1) reroute_output() log.info("------------------------------------------------") log.info(" OpenShot (version %s)" % info.SETUP['version']) log.info("------------------------------------------------") # Create Qt application, pass any unprocessed arguments argv = [sys.argv[0]] for arg in args.remain: argv.append(arg) app = OpenShotApp(argv) # Run and return result sys.exit(app.run())
def main(): """"Initialize settings (not implemented) and create main window/application.""" # Display version and exit (if requested) if "--version" in sys.argv: print("OpenShot version %s" % info.SETUP['version']) exit() log.info("------------------------------------------------") log.info(" OpenShot (version %s)" % info.SETUP['version']) log.info("------------------------------------------------") # Create Qt application app = OpenShotApp(sys.argv) # Run and return result sys.exit(app.run())
def main(): """"Initialize settings (not implemented) and create main window/application.""" parser = argparse.ArgumentParser(description='OpenShot version ' + info.SETUP['version']) parser.add_argument('-l', '--lang', action='store', help='language code for interface (overrides ' 'preferences and system environment)') parser.add_argument('--list-languages', dest='list_languages', action='store_true', help='List all language ' 'codes supported by OpenShot') parser.add_argument('--path', dest='py_path', action='append', help='Additional locations to search for modules ' '(PYTHONPATH). Can be used multiple times.') parser.add_argument('-V', '--version', action='store_true') parser.add_argument('remain', nargs=argparse.REMAINDER, help=argparse.SUPPRESS) args = parser.parse_args() # Display version and exit (if requested) if args.version: print("OpenShot version %s" % info.SETUP['version']) sys.exit() if args.list_languages: from classes.language import get_all_languages print("Supported Languages:") for lang in get_all_languages(): print(" {:>12} {}".format(lang[0], lang[1])) sys.exit() if args.py_path: for p in args.py_path: try: if os.path.exists(os.path.realpath(p)): sys.path.insert(0, os.path.realpath(p)) print("Added {} to PYTHONPATH".format(os.path.realpath(p))) else: print("{} does not exist".format(os.path.realpath(p))) except TypeError as ex: print("Bad path {}: {}".format(p, ex)) continue if args.lang: if args.lang in info.SUPPORTED_LANGUAGES: info.CMDLINE_LANGUAGE = args.lang else: print("Unsupported language '{}'! (See --list-languages)".format( args.lang)) sys.exit(-1) # Create Qt application, pass any unprocessed arguments from classes.app import OpenShotApp argv = [sys.argv[0]] for arg in args.remain: argv.append(arg) app = OpenShotApp(argv) # Run and return result sys.exit(app.run())