本文整理汇总了Python中vistrails.core.vistrail.controller.VistrailController.flush_delayed_actions方法的典型用法代码示例。如果您正苦于以下问题:Python VistrailController.flush_delayed_actions方法的具体用法?Python VistrailController.flush_delayed_actions怎么用?Python VistrailController.flush_delayed_actions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vistrails.core.vistrail.controller.VistrailController
的用法示例。
在下文中一共展示了VistrailController.flush_delayed_actions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cache
# 需要导入模块: from vistrails.core.vistrail.controller import VistrailController [as 别名]
# 或者: from vistrails.core.vistrail.controller.VistrailController import flush_delayed_actions [as 别名]
def test_cache(self):
from vistrails.core.modules.basic_modules import StandardOutput
old_compute = StandardOutput.compute
StandardOutput.compute = lambda s: None
try:
from vistrails.core.db.locator import XMLFileLocator
from vistrails.core.vistrail.controller import VistrailController
from vistrails.core.db.io import load_vistrail
"""Test if basic caching is working."""
locator = XMLFileLocator(vistrails.core.system.vistrails_root_directory() +
'/tests/resources/dummy.xml')
(v, abstractions, thumbnails, mashups) = load_vistrail(locator)
# the controller will take care of upgrades
controller = VistrailController(v, locator, abstractions,
thumbnails, mashups)
p1 = v.getPipeline('int chain')
n = v.get_version_number('int chain')
controller.change_selected_version(n)
controller.flush_delayed_actions()
p1 = controller.current_pipeline
view = DummyView()
interpreter = CachedInterpreter.get()
result = interpreter.execute(p1,
locator=v,
current_version=n,
view=view,
)
# to force fresh params
p2 = v.getPipeline('int chain')
controller.change_selected_version(n)
controller.flush_delayed_actions()
p2 = controller.current_pipeline
result = interpreter.execute(p2,
locator=v,
current_version=n,
view=view,
)
self.assertEqual(len(result.modules_added), 1)
finally:
StandardOutput.compute = old_compute