Commits

Aleš Erjavec  committed 6abbcdf

Widget registry documentation fixup.

  • Participants
  • Parent commits b5bc81b

Comments (0)

Files changed (3)

File Orange/OrangeCanvas/registry/__init__.py

 """
+========
+Registry
+========
+
 The registry module implements discovery and description of the widgets
 that are available/installed. The :class:`WidgetRegistry` is a repository
 of :class:`WidgetDescription` and :class:`CategoryDescription` instances

File Orange/OrangeCanvas/registry/base.py

 """
-WidgetRegistry Base
+===============
+Widget Registry
+===============
 
 """
 
     """
     A container for widget and category descriptions.
 
-    This class is most often used with WidgetDiscovery class but can
-    be used separately.
-
     >>> reg = WidgetRegistry()
     >>> file_desc = WidgetDescription.from_module(
     ...     "Orange.OrangeWidgets.Data.OWFile"
     other : :class:`WidgetRegistry`, optional
         If supplied the registry is initialized with the contents of `other`.
 
+    See also
+    --------
+    WidgetDiscovery
+
     """
 
     def __init__(self, other=None):
         # A list of (category, widgets_list) tuples ordered by priority.
         self.registry = []
+
         # tuples from 'registry' indexed by name
         self._categories_dict = {}
-        # WidgetDscriptions by qualified name
+
+        # WidgetDecriptions by qualified name
         self._widgets_dict = {}
 
         if other is not None:
     def categories(self):
         """
         Return a list all top level :class:`CategoryDescription` instances
-        ordered by priority.
+        ordered by `priority`.
 
         """
         return [c for c, _ in self.registry]
 
     def category(self, name):
         """
-        Find a :class:`CategoryDescription` by its `name`.
+        Find and return a :class:`CategoryDescription` by its `name`.
 
         .. note:: Categories are identified by `name` attribute in contrast
                   with widgets which are identified by `qualified_name`.
 
     def has_category(self, name):
         """
-        Does a category with `name` exist in this registry.
+        Return ``True`` if a category with `name` exist in this registry.
 
         Parameters
         ----------
         qualified_name : str
             Widget description qualified name
 
-        See also
-        --------
-        WidgetDescription
-
         """
         return self._widgets_dict[qualified_name]
 
     def has_widget(self, qualified_name):
         """
-        Does the widget with `qualified_name` exist in this registry.
+        Return ``True`` if the widget with `qualified_name` exists in
+        this registry.
+
         """
         return qualified_name in self._widgets_dict
 

File Orange/OrangeCanvas/registry/description.py

 
 
 class InputSignal(object):
-    """Description of an input channel.
+    """
+    Description of an input channel.
 
     Parameters
     ----------
 
 
 class OutputSignal(object):
-    """Description of an output channel.
+    """
+    Description of an output channel.
 
     Parameters
     ----------
 
 
 class WidgetDescription(object):
-    """Description of a widget.
+    """
+    Description of a widget.
 
     Parameters
     ----------
         A package name where the widget is implemented.
     project_name : str, optional
         The distribution name that provides the widget.
-    inputs : list of `InputSignal`, optional
+    inputs : list of :class:`InputSignal`, optional
         A list of input channels provided by the widget.
-    outputs : list of `OutputSignal`, optional
+    outputs : list of :class:`OutputSignal`, optional
         A list of output channels provided by the widget.
     help : str, optional
         URL or an Resource template of a detailed widget help page.
 
     @classmethod
     def from_file(cls, filename, import_name=None):
-        """Widget description from old style (2.5 version) widget
+        """
+        Widget description from old style (2.5 version) widget
         descriptions.
 
         """
 
     @classmethod
     def from_module(cls, module):
-        """Get the widget description from a module.
+        """
+        Get the widget description from a module.
 
         The module is inspected for global variables (upper case versions of
         `WidgetDescription.__init__` parameters).
 
 
 class CategoryDescription(object):
-    """Description of a widget category.
+    """
+    Description of a widget category.
 
     Parameters
     ----------
 
     name : str
         A human readable name.
-    version : str
-        Version string (optional).
-    description : str
-        A short description of the category, suitable for a tool
-        tip (optional).
-    long_description : str
+    version : str, optional
+        Version string.
+    description : str, optional
+        A short description of the category, suitable for a tool tip.
+    long_description : str, optional
         A longer description.
-    qualified_name : str
+    qualified_name : str,
         Qualified name
     project_name : str
         A project name providing the category.
     priority : int
         Priority (order in the GUI).
     icon : str
-        An icon filename
+        An icon filename (a resource name retrievable using `pkg_resources`
+        relative to `qualified_name`).
     background : str
         An background color for widgets in this category.
 
 
     @classmethod
     def from_package(cls, package):
-        """Get the CategoryDescription from a package.
+        """
+        Get the CategoryDescription from a package.
 
         Parameters
         ----------