Example #1
0
def main():
    """Entry point to `carrie` command line tool."""

    # <program>  Copyright (C) <year>  <name of author>
    # This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    # This is free software, and you are welcome to redistribute it
    # under certain conditions; type `carrie --license' for details.
    parser = argparse.ArgumentParser(
        description='Carrie remote control server')
    parser.add_argument('--fifo', '-f', help='Name of mplayer fifo')
    parser.add_argument(
        '--console',
        action='store_true',
        help='Open a debug console connection instead of normal operations')
    parser.add_argument('--port',
                        '-p',
                        type=int,
                        default=DEFAULT_PORT,
                        help='HTTP port to listen on')
    parser.add_argument('--logfile',
                        metavar='LOG',
                        help='Log to LOG instead of stdout')
    parser.add_argument('--debug',
                        '-d',
                        action='store_true',
                        help='Use flask debug mode')
    args = parser.parse_args()

    # set up logging
    log.init_log(args.logfile)

    fifo.init_fifo(args.fifo)
    # Handle --console option
    if args.console:
        fifo.Console().run()
        parser.exit()

    # Listen for HTTP connections
    server.serve_forever(args.port, args.debug)
Example #2
0
def main():
	"""Entry point to `carrie` command line tool."""

	# <program>  Copyright (C) <year>  <name of author>
    # This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    # This is free software, and you are welcome to redistribute it
    # under certain conditions; type `carrie --license' for details.
	parser = argparse.ArgumentParser(description='Carrie remote control server')
	parser.add_argument('--fifo', '-f',
						help='Name of mplayer fifo')
	parser.add_argument('--console',
						action='store_true',
						help='Open a debug console connection instead of normal operations')
	parser.add_argument('--port', '-p',
						type=int,
						default=DEFAULT_PORT,
						help='HTTP port to listen on')
	parser.add_argument('--logfile',
						metavar='LOG',
						help='Log to LOG instead of stdout')
	parser.add_argument('--debug', '-d',
						action='store_true',
						help='Use flask debug mode')
	args = parser.parse_args()

	# set up logging
	log.init_log(args.logfile)

	fifo.init_fifo(args.fifo)
	# Handle --console option
	if args.console:
		fifo.Console().run()
		parser.exit()

	# Listen for HTTP connections
	server.serve_forever(args.port, args.debug)
Example #3
0
File: xorg.py Project: mjem/carrie
    return None


if __name__ == '__main__':
    from carrie import log
    log.init_log()
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('--autopause', action='store_true')
    parser.add_argument('--autofullscreen', '--autofs', action='store_true')
    parser.add_argument('--tree', action='store_true')
    parser.add_argument('--players', action='store_true')
    args = parser.parse_args()

    fifo.init_fifo()

    if args.tree:
        raw_list()
        parser.exit()

    if args.players:
        player_list(print_player=True, print_match=True)
        parser.exit()

    if args.autopause:
        print auto_command('pause')
        parser.exit()

    if args.autofullscreen:
        print auto_command('fullscreen')
Example #4
0
File: xorg.py Project: mjem/carrie
if __name__ == '__main__':
	from carrie import log
	log.init_log()
	import argparse
	parser = argparse.ArgumentParser()
	parser.add_argument('--autopause',
						action='store_true')
	parser.add_argument('--autofullscreen', '--autofs',
						action='store_true')
	parser.add_argument('--tree',
						action='store_true')
	parser.add_argument('--players',
						action='store_true')
	args = parser.parse_args()

	fifo.init_fifo()

	if args.tree:
		raw_list()
		parser.exit()

	if args.players:
		player_list(print_player=True, print_match=True)
		parser.exit()

	if args.autopause:
		print auto_command('pause')
		parser.exit()

	if args.autofullscreen:
		print auto_command('fullscreen')