本文整理汇总了Python中enaml.workbench.api.Workbench类的典型用法代码示例。如果您正苦于以下问题:Python Workbench类的具体用法?Python Workbench怎么用?Python Workbench使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Workbench类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: workbench
def workbench():
"""Create a workbench and register basic manifests.
"""
workbench = Workbench()
workbench.register(CoreManifest())
workbench.register(ErrorsManifest())
return workbench
示例2: test_registration
def test_registration(windows):
"""Test that the manifest is properly regsistered.
"""
w = Workbench()
w.register(CoreManifest())
w.register(ErrorsManifest())
w.register(PackagesManifest())
with signal_error_raise():
w.get_plugin('ecpy.app.packages').collect_and_register()
# Edit the name of the package
assert w.get_plugin('ecpy_ext_demo')
示例3: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(AppManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(StateManifest())
self.workbench.register(LogManifest())
示例4: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(DependenciesManifest())
self.workbench.register(BuildDep())
self.workbench.register(RuntimeDep())
示例5: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(DependenciesManifest())
示例6: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(DependenciesManifest())
self.workbench.register(TaskManagerManifest())
self.workbench.register(MeasureManifest())
self.workbench.register(TestSuiteManifest())
示例7: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(DependenciesManifest())
self.workbench.register(PulsesManagerManifest())
self.plugin = self.workbench.get_plugin('hqc_meas.pulses')
示例8: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(TaskManagerManifest())
self.root = RootTask(should_stop=Event(), should_pause=Event())
self.task = LoadArrayTask(task_name='Test')
self.root.children_task.append(self.task)
示例9: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(UIManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(LogManifest())
self.workbench.register(MeasureManifest())
# Needed otherwise the monitor manifest is not registered.
self.workbench.get_plugin(u'hqc_meas.measure')
示例10: workbench
def workbench():
workbench = Workbench()
workbench.register(CoreManifest())
workbench.register(ContextManifest())
workbench.register(TestManifest())
context = workbench.get_plugin('psi.context')
print context.selectors['default'].order
print context.selectors['default'].parameters
print context.context_items['repetitions'].rove
for r in (20, 15, 10, 2):
context.selectors['default'].add_setting(dict(repetitions=r))
return workbench
示例11: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(InstrManagerManifest())
self.workbench.register(TaskManagerManifest())
self.root = RootTask(should_stop=Event(), should_pause=Event())
self.task = ApplyMagFieldTask(task_name='Test')
self.root.children_task.append(self.task)
self.root.run_time['drivers'] = {'Test': InstrHelper}
示例12: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(UIManifest())
self.workbench.register(HqcAppManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(LogManifest())
self.workbench.register(TaskManagerManifest())
self.workbench.register(InstrManagerManifest())
self.workbench.register(DebuggerManifest())
self.workbench.register(TestSuiteManifest())
示例13: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(UIManifest())
self.workbench.register(HqcAppManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(LogManifest())
self.workbench.register(DependenciesManifest())
self.workbench.register(TaskManagerManifest())
self.workbench.register(InstrManagerManifest())
self.workbench.register(MeasureManifest())
self.workbench.register(TestSuiteManifest())
# Adding by hand the false instr task.
plugin = self.workbench.get_plugin('hqc_meas.task_manager')
plugin._py_tasks['False instr'] = FalseInstrTask
示例14: setup
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(StateManifest())
self.workbench.register(PreferencesManifest())
self.workbench.register(InstrManagerManifest())
self.workbench.register(PulsesManagerManifest())
self.workbench.register(TaskManagerManifest())
self.root = RootTask(should_stop=Event(), should_pause=Event())
self.task = TransferPulseSequenceTask(task_name='Test')
self.root.children_task.append(self.task)
self.root.run_time['drivers'] = {'Test': InstrHelper}
self.sequence = RootSequence()
self.context = AWGContext()
self.sequence.context = self.context
self.sequence.external_vars = {'a': None}
pulse1 = Pulse(def_1='1.0', def_2='{a}', channel='Ch1_M1')
pulse2 = Pulse(def_1='{a} + 1.0', def_2='4.0', channel='Ch1_M1')
pulse3 = Pulse(def_1='{2_stop} + 0.5', def_2='10', channel='Ch1_M1')
self.sequence.items.extend([pulse1, pulse2, pulse3])
示例15: TestCollectingFromObject
class TestCollectingFromObject(object):
"""Test collecting dependencies of live objects.
"""
def setup(self):
self.workbench = Workbench()
self.workbench.register(CoreManifest())
self.workbench.register(DependenciesManifest())
self.workbench.register(BuildDep())
self.workbench.register(RuntimeDep())
def teardown(self):
self.workbench.unregister('ecpy.app.dependencies')
self.workbench.unregister('enaml.workbench.core')
def test_collecting_build(self, dependent_object):
"""Test collecting only the build dependencies.
"""
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object})
assert res
assert dep.keys() == ['test']
def test_collecting_runtime(self, dependent_object):
"""Test collecting only the runtime dependencies.
"""
plugin = self.workbench.get_plugin('ecpy.app.dependencies')
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object,
'dependencies': ['runtime']},
plugin)
assert res
assert dep.keys() == ['test_run']
def test_collecting_all(self, dependent_object):
"""Test collecting all dependencies.
"""
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object,
'dependencies': ['build',
'runtime'],
'owner': 'ecpy.test'})
assert res
assert dep[0].keys() == ['test']
assert dep[1].keys() == ['test_run']
def test_handling_errors(self, monkeypatch, dependent_object):
"""Test handling errors occuring when collecting dependencies.
"""
plugin = self.workbench.get_plugin('ecpy.app.dependencies')
for b in plugin.build_deps.contributions.values():
monkeypatch.setattr(b, 'err', True)
for r in plugin.run_deps.contributions.values():
monkeypatch.setattr(r, 'err', True)
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object,
'dependencies': ['build',
'runtime'],
'owner': 'ecpy.test'})
assert not res
assert 'test' in dep[0] and 'test_run' in dep[1]
def test_handling_missing_caller(self, dependent_object):
"""Test handling a missing caller when runtime dependencies are
requested.
"""
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object,
'dependencies': ['runtime']})
assert not res
assert 'owner' in dep
def test_handling_unknown_dep_type(self, dependent_object):
"""Test handling an unknown dep_type.
"""
dependent_object.dep_type = 'Unknown'
core = self.workbench.get_plugin('enaml.workbench.core')
res, dep = core.invoke_command(COLLECT, {'obj': dependent_object})
assert not res
assert 'Unknown' in dep
def test_handling_missing_runtime_collector(self, monkeypatch,
dependent_object):
"""Test handling an unknown dep_type.
"""
plugin = self.workbench.get_plugin('ecpy.app.dependencies')
#.........这里部分代码省略.........