handler.py 文件源码

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

项目:TACTIC-Handler 作者: listyque 项目源码 文件源码
def get_value(my, path):
        parts = path.split("/")
        current = my.package
        for part in parts:
            current = current.get(part)
            # explict None comparison: empty string should go through
            if current == None:
                raise HandlerException("Part [%s] does not exist in package" % part)

        # if this is still a dictionary and it has __VALUE__ in it, the
        # get that value
        if type(current) == types.DictionaryType and current.has_key("__VALUE__"):
            current = current.get("__VALUE__")

        if type(current) == types.ListType:
            return current[0]
        else:
            return current
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号