当前位置: 首页>>代码示例>>Python>>正文


Python JsonPointer.resolve方法代码示例

本文整理汇总了Python中jsonpointer.JsonPointer.resolve方法的典型用法代码示例。如果您正苦于以下问题:Python JsonPointer.resolve方法的具体用法?Python JsonPointer.resolve怎么用?Python JsonPointer.resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jsonpointer.JsonPointer的用法示例。


在下文中一共展示了JsonPointer.resolve方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add

# 需要导入模块: from jsonpointer import JsonPointer [as 别名]
# 或者: from jsonpointer.JsonPointer import resolve [as 别名]
    def add(self, name, value, *ignored_args, **ignored_kwargs):
        """ Adds a new JSON Pointer expression to the store.
        """
        # Make sure it's valid, no exception in 'resolve' means the expression was valid.
        pointer = JsonPointer(value)
        pointer.resolve({}, None)

        with self.update_lock:
            self.data[name] = pointer
开发者ID:remcoboerma,项目名称:zato,代码行数:11,代码来源:message.py

示例2: createOffsetMeta

# 需要导入模块: from jsonpointer import JsonPointer [as 别名]
# 或者: from jsonpointer.JsonPointer import resolve [as 别名]
def createOffsetMeta(offset, bookkeeping):
    '''
    sets up a location to track rule and step ids for a given scope offset
    '''
    pointer = JsonPointer(offset)
    view = bookkeeping
    for x in pointer.parts:
        view = view.setdefault(x,{})
    pointer.resolve(bookkeeping).setdefault('_meta',{'stages': [], 'steps': []})
开发者ID:lukasheinrich,项目名称:yadage,代码行数:11,代码来源:wflowview.py

示例3: addRule

# 需要导入模块: from jsonpointer import JsonPointer [as 别名]
# 或者: from jsonpointer.JsonPointer import resolve [as 别名]
    def addRule(self, rule, offset='', identifier = None):
        '''
        add a DAG extension rule, possibly with a scope offset
        '''
        thisoffset = JsonPointer(offset)
        if offset != '':
            createIndexData(thisoffset.path, self.steps, self.values)
        createOffsetMeta(thisoffset.path, self.bookkeeper)

        offsetstage = OffsetStage(rule, self._makeoffset(offset), identifier = identifier)
        self.rules += [offsetstage]
        thisoffset.resolve(self.bookkeeper)['_meta']['stages'] += [offsetstage.identifier]
        return offsetstage.identifier
开发者ID:lukasheinrich,项目名称:yadage,代码行数:15,代码来源:wflowview.py

示例4: resolve

# 需要导入模块: from jsonpointer import JsonPointer [as 别名]
# 或者: from jsonpointer.JsonPointer import resolve [as 别名]
 def resolve(self, doc, default=jsonpointer._nothing):
     if self.isHash:
         if len(self.parts) == 1:
             refdata = doc
         else:
             p = JsonPointer('/' + '/'.join(self.parts[:-1]))
             refdata = p.resolve(doc)
         if isinstance(refdata, list):
             return int(self.parts[-1])
         else:
             return self.parts[-1]
     else:
         return super(RelJsonPointer, self).resolve(doc, default)
开发者ID:riverbed,项目名称:reschema,代码行数:15,代码来源:reljsonpointer.py

示例5: createIndexData

# 需要导入模块: from jsonpointer import JsonPointer [as 别名]
# 或者: from jsonpointer.JsonPointer import resolve [as 别名]
def createIndexData(offset, stepindex, valueindex):
    pointer = JsonPointer(offset)
    pointer.resolve(stepindex)['_offset'] = offset
    pointer.set(valueindex, {})
开发者ID:lukasheinrich,项目名称:yadage,代码行数:6,代码来源:wflowview.py


注:本文中的jsonpointer.JsonPointer.resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。