Pmw.py 文件源码

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

项目:ecel 作者: ARL-UTEP-OC 项目源码 文件源码
def _datatype(self):
        datatype = self['datatype']

        if type(datatype) is types.DictionaryType:
            self._counterArgs = datatype.copy()
            if self._counterArgs.has_key('counter'):
                datatype = self._counterArgs['counter']
                del self._counterArgs['counter']
            else:
                datatype = 'numeric'
        else:
            self._counterArgs = {}

        if _counterCommands.has_key(datatype):
            self._counterCommand = _counterCommands[datatype]
        elif callable(datatype):
            self._counterCommand = datatype
        else:
            validValues = _counterCommands.keys()
            validValues.sort()
            raise ValueError, ('bad datatype value "%s":  must be a' +
                    ' function or one of %s') % (datatype, validValues)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号