def __setitem__(self, cmd, value):
        '''
        Set aliases for functions
        '''
        if '.' not in cmd and not self.cmd_prefix:
            # Form of salt.cmd.run in Jinja -- it's expecting a subdictionary
            # containing only 'cmd' module calls, in that case. We don't
            # support assigning directly to prefixes in this way
            raise KeyError('Cannot assign to module key {0} in the '
                           'FunctionWrapper'.format(cmd))

        if self.cmd_prefix:
            # We're in an inner FunctionWrapper as created by the first code
            # block in __getitem__. Reconstruct the original cmd in the form
            # 'cmd.run' and then evaluate as normal
            cmd = '{0}.{1}'.format(self.cmd_prefix, cmd)

        if cmd in self.wfuncs:
            self.wfuncs[cmd] = value

        # Here was assume `value` is a `caller` function from __getitem__.
        # We save it as an alias and then can return it when referenced
        # later in __getitem__
        self.aliases[cmd] = value
def __setitem__ ( self , cmd , value ) : if '.' not in cmd and not self . cmd_prefix : raise KeyError ( 'Cannot assign to module key {0} in the ' 'FunctionWrapper' . format ( cmd ) ) if self . cmd_prefix : cmd = '{0}.{1}' . format ( self . cmd_prefix , cmd ) if cmd in self . wfuncs : self . wfuncs [ cmd ] = value self . aliases [ cmd ] = value
Set aliases for functions