예제 #1
0
def _exec_no_show_result(composedleaf):
	pretty.print_debug(__name__, "Evaluating command", composedleaf)
	obj, action, iobj = composedleaf.object
	ret = commandexec.activate_action(*composedleaf.object)
	result_type = commandexec.parse_action_result(action, ret)
	if result_type == commandexec.RESULT_OBJECT:
		return ret
	if result_type == commandexec.RESULT_SOURCE:
		try:
			return iter(ret.get_leaves()).next()
		except StopIteration:
			pass
예제 #2
0
def _exec_no_show_result(composedleaf):
	pretty.print_debug(__name__, "Evaluating command", composedleaf)
	obj, action, iobj = composedleaf.object
	ret = commandexec.activate_action(*composedleaf.object)
	result_type = commandexec.parse_action_result(action, ret)
	if result_type == commandexec.RESULT_OBJECT:
		return ret
	if result_type == commandexec.RESULT_SOURCE:
		leaves = list(ret.get_leaves())
		if not leaves:
			return
		if len(leaves) == 1:
			return leaves[0]
		else:
			return MultipleLeaf(leaves)