Commit a3716cf8 authored by jtc42's avatar jtc42
Browse files

Tidied up debug statements

parent 3c096e9b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ def construct_blueprint(microscope_obj):

                # Store the complete form in Microscope().plugin.form
                microscope_obj.plugins.forms.append(api_form_info)
                print(microscope_obj.plugins.forms)

        else:
            warnings.warn(
+0 −32
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ def plugins_representation(plugin_loader_object: PluginLoader):
    """
    plugins = []

    print(plugin_loader_object.active)

    for plugin in plugin_loader_object.active:
        logging.info(f"Representing plugin {plugin._name}")
        d = {
@@ -42,12 +40,8 @@ def plugins_representation(plugin_loader_object: PluginLoader):

            d["views"][view_id] = view_d

        print("\n")
        print(d)
        print("\n")
        plugins.append(d)

    print(plugins)
    return plugins


@@ -93,30 +87,4 @@ def construct_blueprint(microscope_obj):
                ),
            )

            """
            # If plugin includes an API form
            if hasattr(plugin_obj, "api_form") and isinstance(
                plugin_obj.api_form, dict
            ):
                # TODO: We deep copy this to avoid clashing between API versions. Can be removed when v1 is removed.
                api_form_info = copy.deepcopy(plugin_obj.api_form)
                api_form_info["id"] = plugin_name
                if "forms" in api_form_info and isinstance(
                    api_form_info["forms"], list
                ):
                    for form in api_form_info["forms"]:
                        if "route" in form and form["route"] in expanded_routes.keys():
                            form["route"] = expanded_routes[form["route"]]
                        else:
                            logging.warn(
                                "No valid expandable route found for {}".format(
                                    form["route"]
                                )
                            )

                # Store the complete form in Microscope().plugin.form
                plugin_representation["form"] = api_form_info
                print(microscope_obj.plugins.forms)
            """

    return blueprint
+2 −6
Original line number Diff line number Diff line
@@ -229,8 +229,8 @@ class BasePlugin:
    """

    def __init__(self):
        self._views = {}
        self._rules = {}
        self._views = {}  # Key: Full, Python-safe ID. Val: Original rule, and view class
        self._rules = {}  # Key: Original rule. Val: View class
        self._form = None

        # If old api_views dictionary is found
@@ -242,10 +242,6 @@ class BasePlugin:
            # Convert to new format
            self._convert_old_api_form()

        print("\n\n NAME: " + self._name + "\n\n")
        print(self.views)
        print(self.form)

    @property
    def views(self):
        return self._views