source: orange/Orange/OrangeCanvas/registry/tests/__init__.py @ 11098:b743937fe90a

Revision 11098:b743937fe90a, 990 bytes checked in by Ales Erjavec <ales.erjavec@…>, 19 months ago (diff)

Added new widget/category description classes and new widget discovery.

This includes a Qt item model interface for the registry.

Line 
1"""
2"""
3
4
5def small_testing_registry():
6    """Return a small registry with a few widgets for testing.
7    """
8    from ..description import WidgetDescription, CategoryDescription
9    from .. import WidgetRegistry
10
11    registry = WidgetRegistry()
12
13    data_desc = CategoryDescription.from_package(
14        "Orange.OrangeWidgets.Data"
15    )
16
17    file_desc = WidgetDescription.from_module(
18        "Orange.OrangeWidgets.Data.OWFile"
19    )
20    discretize_desc = WidgetDescription.from_module(
21        "Orange.OrangeWidgets.Data.OWDiscretize"
22    )
23
24    classify_desc = CategoryDescription.from_package(
25        "Orange.OrangeWidgets.Classify"
26    )
27
28    bayes_desc = WidgetDescription.from_module(
29        "Orange.OrangeWidgets.Classify.OWNaiveBayes"
30    )
31
32    registry.register_category(data_desc)
33    registry.register_category(classify_desc)
34    registry.register_widget(file_desc)
35    registry.register_widget(discretize_desc)
36    registry.register_widget(bayes_desc)
37    return registry
Note: See TracBrowser for help on using the repository browser.