human
Complete this python program:
def excmd(fn):
assistant
#Here is the Python program you requested.

    """
    """
    def wrapped(self, *fnargs):
        try:
            args = []
            args.extend(self.required_all)
            fn_name = fn.__name__[3:]
            if hasattr(self, ('required_' + fn_name)):
                args.extend(getattr(self, ('required_' + fn.__name__[3:])))
            self.prompt_for_settings(args)
            self.do_show()
            if self.ask:
                while 1:
                    res = raw_input('Do    these    settings    look    correct?    (y[es]/N[o]/s[kip]/q[uit])    ')
                    if (res.lower() in ['s', 'y']):
                        break
                    elif (res.lower() == 'q'):
                        return 1
                    else:
                        self.prompt_for_settings(args)
            print args
            print self.ns
            for name in args:
                if ((not hasattr(self.ns, name)) or (not getattr(self.ns, name))):
                    r = raw_input(('Variable    %s    is    not    set.    Enter    IGNORE    to    continue    anyways    (warning:    bad    things    will    happen):    ' % name))
                    if (r != 'IGNORE'):
                        return
            if ((not self.ask) or (res.lower() == 'y')):
                res = None
                if (hasattr(self, 'mode') and hasattr(self, ('build_%s_%s_payload' % (self.mode, fn_name)))):
                    res = getattr(self, ('build_%s_%s_payload' % (self.mode, fn_name)))()
                elif hasattr(self, ('build_%s_payload' % fn_name)):
                    res = getattr(self, ('build_%s_payload' % fn_name))()
                if res:
                    self.log.error(('An    error    occurred    while    building    the    payload:    %s' % res))
                    return
                res = fn(self, *fnargs)
                self.payload = None
            else:
                self.log.warning('Action    cancelled.    Fix    settings    and    try    again.')
        except Exception as e:
            self.log.error(('Error    occurred   ...