Ejemplo n.º 1
0
    def dump_settings(self, node: SchemeNode):
        from Orange.widgets.settings import SettingsPrinter

        widget = self.widget_for_node(node)

        pp = SettingsPrinter(indent=4)
        pp.pprint(widget.settingsHandler.pack_data(widget))
    def test_formats_contexts(self):
        settings = dict(
            key1=1,
            key2=2,
            context_settings=[
                Context(param1=1, param2=2, values=dict(value1=1, value2=2)),
                Context(param1=3, param2=4, values=dict(value1=5, value2=6)),
            ],
        )
        pp = SettingsPrinter()

        output = pp.pformat(settings)
        # parameter of all contexts should be visible in the output
        self.assertIn("param1=1", output)
        self.assertIn("param2=2", output)
        self.assertIn("param1=3", output)
        self.assertIn("param2=4", output)
Ejemplo n.º 3
0
    def test_formats_contexts(self):
        settings = dict(key1=1, key2=2,
                        context_settings=[
                            Context(param1=1, param2=2,
                                    values=dict(value1=1,
                                                value2=2)),
                            Context(param1=3, param2=4,
                                    values=dict(value1=5,
                                                value2=6))
                        ])
        pp = SettingsPrinter()

        output = pp.pformat(settings)
        # parameter of all contexts should be visible in the output
        self.assertIn("param1=1", output)
        self.assertIn("param2=2", output)
        self.assertIn("param1=3", output)
        self.assertIn("param2=4", output)
Ejemplo n.º 4
0
    def dump_settings(self, node: SchemeNode):
        from Orange.widgets.settings import SettingsPrinter
        widget = self.widget_for_node(node)

        pp = SettingsPrinter(indent=4)
        pp.pprint(widget.settingsHandler.pack_data(widget))