def execute_command(cmd, args, globals_dict, locals_dict, cmdinfo):
 global command_list
 locals_dict['__cmd__'] = cmd
 locals_dict['__args__'] = args
 if (cmd not in command_list):
  raise TwillNameError(("unknown twill command: '%s'" % (cmd,)))
 eval_str = ('%s(*__args__)' % (cmd,))
 codeobj = compile(eval_str, cmdinfo, 'eval')
 result = eval(codeobj, globals_dict, locals_dict)
 locals_dict['__url__'] = commands.browser.get_url()
 return result

def execute_command ( cmd , args , globals_dict , locals_dict , cmdinfo ) : global command_list locals_dict [ '__cmd__' ] = cmd locals_dict [ '__args__' ] = args if ( cmd not in command_list ) : raise TwillNameError ( ( "unknown twill command: '%s'" % ( cmd , ) ) ) eval_str = ( '%s(*__args__)' % ( cmd , ) ) codeobj = compile ( eval_str , cmdinfo , 'eval' ) result = eval ( codeobj , globals_dict , locals_dict ) locals_dict [ '__url__' ] = commands . browser . get_url ( ) return result
takes a command to be passed to subprocess .