本文整理汇总了Python中ion.util.stored_values.StoredValueManager.read_value_mult方法的典型用法代码示例。如果您正苦于以下问题:Python StoredValueManager.read_value_mult方法的具体用法?Python StoredValueManager.read_value_mult怎么用?Python StoredValueManager.read_value_mult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.util.stored_values.StoredValueManager
的用法示例。
在下文中一共展示了StoredValueManager.read_value_mult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_lookup_values
# 需要导入模块: from ion.util.stored_values import StoredValueManager [as 别名]
# 或者: from ion.util.stored_values.StoredValueManager import read_value_mult [as 别名]
def fetch_lookup_values(self):
doc_keys = []
for lv in self._lookup_values():
context = self.context(lv)
if context.document_key:
document_key = context.document_key
if "$designator" in context.document_key and "reference_designator" in self._stream_config:
document_key = document_key.replace("$designator", self._stream_config["reference_designator"])
doc_keys.append(document_key)
lookup_docs = {}
if doc_keys:
svm = StoredValueManager(Container.instance)
doc_list = svm.read_value_mult(doc_keys)
lookup_docs = dict(zip(doc_keys, doc_list))
for lv in self._lookup_values():
context = self.context(lv)
if context.document_key:
document_key = context.document_key
if "$designator" in context.document_key and "reference_designator" in self._stream_config:
document_key = document_key.replace("$designator", self._stream_config["reference_designator"])
doc = lookup_docs[document_key]
if doc is None:
log.debug("Reference Document for %s not found", document_key)
continue
if context.lookup_value in doc:
self[lv] = [doc[context.lookup_value]] * self._shp[0] if self._shp else doc[context.lookup_value]