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


Python api.Workbench类代码示例

本文整理汇总了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
开发者ID:pombredanne,项目名称:ecpy,代码行数:8,代码来源:test_plugin.py

示例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')
开发者ID:Ecpy,项目名称:ecpy_ext_demo,代码行数:14,代码来源:test_registration.py

示例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())
开发者ID:PhilipVinc,项目名称:ecpy,代码行数:7,代码来源:test_plugin.py

示例4: setup

    def setup(self):

        self.workbench = Workbench()
        self.workbench.register(CoreManifest())
        self.workbench.register(DependenciesManifest())
        self.workbench.register(BuildDep())
        self.workbench.register(RuntimeDep())
开发者ID:pombredanne,项目名称:ecpy,代码行数:7,代码来源:test_plugin.py

示例5: setup

    def setup(self):

        self.workbench = Workbench()
        self.workbench.register(CoreManifest())
        self.workbench.register(StateManifest())
        self.workbench.register(PreferencesManifest())
        self.workbench.register(DependenciesManifest())
开发者ID:PhilipVinc,项目名称:HQCMeas,代码行数:7,代码来源:test_plugin.py

示例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())
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:10,代码来源:test_measure.py

示例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')
开发者ID:PhilipVinc,项目名称:HQCMeas,代码行数:10,代码来源:test_template_config.py

示例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)
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:10,代码来源:test_load_tasks.py

示例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')
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:11,代码来源:test_text_monitor.py

示例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
开发者ID:bburan,项目名称:psiexperiment,代码行数:13,代码来源:test_context.py

示例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}
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:12,代码来源:test_apply_mag_field_task.py

示例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())
开发者ID:PhilipVinc,项目名称:HQCMeas,代码行数:13,代码来源:test_workspace.py

示例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
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:18,代码来源:test_workspace.py

示例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])
开发者ID:PhilipVinc,项目名称:HQCMeas,代码行数:22,代码来源:test_transfer_pulse_sequence_task.py

示例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')
#.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:ecpy,代码行数:101,代码来源:test_plugin.py


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