def argparser(): parser = argparse.ArgumentParser() parser.add_argument( '--control', default=get_config('global', 'control'), help='The remote control to control the stb (default: %(default)s)') parser.add_argument( '--source-pipeline', default=get_config('global', 'source_pipeline'), help='A gstreamer pipeline to use for A/V input (default: ' '%(default)s)') parser.add_argument( '--sink-pipeline', default=get_config('global', 'sink_pipeline'), help='A gstreamer pipeline to use for video output ' '(default: %(default)s)') parser.add_argument( '--restart-source', action='store_true', default=get_config('global', 'restart_source', type_=bool), help='Restart the GStreamer source pipeline when video loss is ' 'detected') parser.add_argument( '--save-video', help='Record video to the specified file', metavar='FILE', default=get_config('run', 'save_video')) logging.argparser_add_verbose_argument(parser) return parser
def argparser(): parser = argparse.ArgumentParser() parser.add_argument( '--control', default=get_config('global', 'control'), help='The remote control to control the stb (default: %(default)s)') parser.add_argument( '--source-pipeline', default=get_config('global', 'source_pipeline'), help='A gstreamer pipeline to use for A/V input (default: ' '%(default)s)') parser.add_argument('--sink-pipeline', default=get_config('global', 'sink_pipeline'), help='A gstreamer pipeline to use for video output ' '(default: %(default)s)') parser.add_argument( '--restart-source', action='store_true', default=get_config('global', 'restart_source', type_=bool), help='Restart the GStreamer source pipeline when video loss is ' 'detected') parser.add_argument('--save-video', help='Record video to the specified file', metavar='FILE', default=get_config('run', 'save_video')) logging.argparser_add_verbose_argument(parser) return parser
def main(argv): parser = argparse.ArgumentParser( epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument( "--input", default="lircd", help="""The source of remote control presses. Values are the same as stbt record's --control-recorder.""") parser.add_argument("output", nargs="+", help="""One or more remote control configurations. Values are the same as stbt run's --control.""") argparser_add_verbose_argument(parser) args = parser.parse_args(argv[1:]) signal.signal(signal.SIGTERM, lambda _signo, _stack_frame: sys.exit(0)) r = MultiRemote(uri_to_remote(x) for x in args.output) listener = uri_to_remote_recorder(args.input) for key in listener: debug("Received %s" % key) try: r.press(key) except Exception as e: # pylint: disable=broad-except sys.stderr.write("Error pressing key %r: %s\n" % (key, e))
def argparser(): parser = argparse.ArgumentParser() parser.add_argument( '--control', default=get_config('global', 'control'), help='The remote control to control the stb (default: %(default)s)') parser.add_argument( '--source-pipeline', default=get_config('global', 'source_pipeline'), help='A gstreamer pipeline to use for A/V input (default: ' '%(default)s)') parser.add_argument( '--sink-pipeline', default=get_config('global', 'sink_pipeline'), help='A gstreamer pipeline to use for video output ' '(default: %(default)s)') parser.add_argument( '--save-video', help='Record video to the specified file', metavar='FILE', default=get_config('run', 'save_video')) logging.argparser_add_verbose_argument(parser) return parser
def main(argv): parser = argparse.ArgumentParser( epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("--input", default="lircd", help="""The source of remote control presses. Values are the same as stbt record's --control-recorder.""") parser.add_argument("output", nargs="+", help="""One or more remote control configurations. Values are the same as stbt run's --control.""") argparser_add_verbose_argument(parser) args = parser.parse_args(argv[1:]) signal.signal(signal.SIGTERM, lambda _signo, _stack_frame: sys.exit(0)) r = MultiRemote(uri_to_remote(x) for x in args.output) listener = uri_to_remote_recorder(args.input) for key in listener: debug("Received %s" % key) try: r.press(key) except Exception as e: # pylint: disable=broad-except sys.stderr.write("Error pressing key %r: %s\n" % (key, e))