Logo Search packages:      
Sourcecode: aap version File versions

def aap-1.090::DoConf::ConfContext::RunAction (   self,
  action,
  text,
  src,
  trg 
)

Run action "action" with source "src" and target "trg".
When "text" is not None write it to "src".
Afterwards "src" is always deleted.
Returns an empty string for success, an error message for failure.

Definition at line 120 of file DoConf.py.

00120                                                :
        """
        Run action "action" with source "src" and target "trg".
        When "text" is not None write it to "src".
        Afterwards "src" is always deleted.
        Returns an empty string for success, an error message for failure.
        """
        save_message = Global.globals.get("MESSAGE")
        Global.globals["MESSAGE"] = ""
        save_sys_cmd_log = Global.sys_cmd_log
        Global.sys_cmd_log = " "

        try:
            from Commands import aap_do
            if text:
                f = open(src, "w")
                f.write(text)
                f.close()
            aap_do(0, Global.globals, "%s {target = %s} %s"
                                                          % (action, trg, src))
            msg = ""

            # If there is no error but there is output, log it (e.g., for a
            # warning).
            if Global.sys_cmd_log != " ": 
                msg_log(Global.globals, Global.sys_cmd_log)

        except UserError:
            msg = ((_("Failed to %s test program:") % action)
                                               + Global.sys_cmd_log)

        if save_message is None:
            del Global.globals["MESSAGE"]
        else:
            Global.globals["MESSAGE"] = save_message
        Global.sys_cmd_log = save_sys_cmd_log

        try_delete(src)
        return msg



def init_conf_dict(confdict):


Generated by  Doxygen 1.6.0   Back to index