def add_host(argv=sys.argv): nickname, host_url = argv[1:3] if not config.get_host_info(nickname): config.set_host_info(nickname, {'url':host_url}) print "Added %s to thundercat" % nickname print "%s already exists in thundercat." % nickname
def discover_command(argv=sys.argv): host_info = config.get_host_info(argv[1]) response, info = discover(host_info['url']) if info: config.set_host_info(argv[1], info) print response