lpf.py 文件源码

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

项目:GRIPy 作者: giruenf 项目源码 文件源码
def GetValue(self, item, col):
        obj = self.ItemToObject(item)    
        if isinstance(obj, TrackController):
            if col == 0:
                if obj.model.label:
                    return obj.model.label
                return 'Track ' + str(obj.model.pos + 1)
            return wx.EmptyString     
        elif isinstance(obj, TrackObjectController):
            if col == 0:
                return wx.EmptyString 
            elif col == 1:
                try:
                    if obj.model.obj_tid:
                        ret = ObjectManager.get_tid_friendly_name(obj.model.obj_tid)
                        if ret:
                            return ret
                        return wx.EmptyString
                    else:
                        return 'Select...'
                except AttributeError:
                    print '\nERRO! O objeto nao possui model: ' + str(obj.uid) + '\n'
                    return ''
            elif col == 2:    
                om_obj = obj.get_object()
                if om_obj:
                    return om_obj.name
                return 'Select...' 
        else:
            raise RuntimeError("unknown node type")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号