Exemple #1
0
def main():
	from carrie import log
	log.init_log()
	import argparse
	parser = argparse.ArgumentParser()
	parser.add_argument('--show',
						action='store_true')
	parser.add_argument('--volup',
						action='store_true')
	parser.add_argument('--voldown',
						action='store_true')
	args = parser.parse_args()

	if args.show:
		print get_volume()
		parser.exit()

	elif args.volup:
		volup()
		parser.exit()

	elif args.voldown:
		voldown()
		parser.exit()

	parser.error('No actions specified')
Exemple #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)
Exemple #3
0
def main():
    from carrie import log
    log.init_log()
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('--show', action='store_true')
    parser.add_argument('--volup', action='store_true')
    parser.add_argument('--voldown', action='store_true')
    args = parser.parse_args()

    if args.show:
        print get_volume()
        parser.exit()

    elif args.volup:
        volup()
        parser.exit()

    elif args.voldown:
        voldown()
        parser.exit()

    parser.error('No actions specified')
Exemple #4
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)
Exemple #5
0
def get_mouse_pos():
    """Return a tuple of mouse x,y position, as strings.
	"""

    matcher = re.compile(r'x:(?P<x>\d+) y:(?P<y>\d+) screen:')
    for line in shell('xdotool', 'getmouselocation'):
        match = matcher.match(line)
        if match is not None:
            return match.group('x'), match.group('y')

    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:
Exemple #6
0
def get_mouse_pos():
	"""Return a tuple of mouse x,y position, as strings.
	"""

	matcher = re.compile(r'x:(?P<x>\d+) y:(?P<y>\d+) screen:')
	for line in shell('xdotool', 'getmouselocation'):
		match = matcher.match(line)
		if match is not None:
			return match.group('x'), match.group('y')

	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: