amp.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:hostapd-mana 作者: adde88 项目源码 文件源码
def lookupFunction(self, name):
        """
        Return a callable to invoke when executing the named command.

        @param name: the normalized name (from the wire) of the command.

        @return: a function that takes one argument (a Box) and returns a box,
        for handling the command identified by the given name.
        """
        # Try to find a high-level method to invoke, and if we can't find one,
        # fall back to a low-level one.
        cd = self._commandDispatch
        if name in cd:
            commandClass, responderFunc = cd[name]
            responderMethod = types.MethodType(responderFunc, self, self.__class__)
            return self._wrapWithSerialization(responderMethod, commandClass)

        # Fall back to simplistic command dispatching - this uses only strings,
        # not encoded/decoded values.
        fName = self.baseDispatchPrefix + (name.upper())
        return getattr(self, fName, None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号