Changeset 11418:6abbcdf4ff7c in orange


Ignore:
Timestamp:
03/21/13 13:26:58 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Widget registry documentation fixup.

Location:
Orange/OrangeCanvas/registry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/registry/__init__.py

    r11368 r11418  
    11""" 
     2======== 
     3Registry 
     4======== 
     5 
    26The registry module implements discovery and description of the widgets 
    37that are available/installed. The :class:`WidgetRegistry` is a repository 
  • Orange/OrangeCanvas/registry/base.py

    r11368 r11418  
    11""" 
    2 WidgetRegistry Base 
     2=============== 
     3Widget Registry 
     4=============== 
    35 
    46""" 
     
    2022    """ 
    2123    A container for widget and category descriptions. 
    22  
    23     This class is most often used with WidgetDiscovery class but can 
    24     be used separately. 
    2524 
    2625    >>> reg = WidgetRegistry() 
     
    3837        If supplied the registry is initialized with the contents of `other`. 
    3938 
     39    See also 
     40    -------- 
     41    WidgetDiscovery 
     42 
    4043    """ 
    4144 
     
    4346        # A list of (category, widgets_list) tuples ordered by priority. 
    4447        self.registry = [] 
     48 
    4549        # tuples from 'registry' indexed by name 
    4650        self._categories_dict = {} 
    47         # WidgetDscriptions by qualified name 
     51 
     52        # WidgetDecriptions by qualified name 
    4853        self._widgets_dict = {} 
    4954 
     
    6065        """ 
    6166        Return a list all top level :class:`CategoryDescription` instances 
    62         ordered by priority. 
     67        ordered by `priority`. 
    6368 
    6469        """ 
     
    6772    def category(self, name): 
    6873        """ 
    69         Find a :class:`CategoryDescription` by its `name`. 
     74        Find and return a :class:`CategoryDescription` by its `name`. 
    7075 
    7176        .. note:: Categories are identified by `name` attribute in contrast 
     
    8287    def has_category(self, name): 
    8388        """ 
    84         Does a category with `name` exist in this registry. 
     89        Return ``True`` if a category with `name` exist in this registry. 
    8590 
    8691        Parameters 
     
    130135            Widget description qualified name 
    131136 
    132         See also 
    133         -------- 
    134         WidgetDescription 
    135  
    136137        """ 
    137138        return self._widgets_dict[qualified_name] 
     
    139140    def has_widget(self, qualified_name): 
    140141        """ 
    141         Does the widget with `qualified_name` exist in this registry. 
     142        Return ``True`` if the widget with `qualified_name` exists in 
     143        this registry. 
     144 
    142145        """ 
    143146        return qualified_name in self._widgets_dict 
  • Orange/OrangeCanvas/registry/description.py

    r11368 r11418  
    5353 
    5454class InputSignal(object): 
    55     """Description of an input channel. 
     55    """ 
     56    Description of an input channel. 
    5657 
    5758    Parameters 
     
    116117 
    117118class OutputSignal(object): 
    118     """Description of an output channel. 
     119    """ 
     120    Description of an output channel. 
    119121 
    120122    Parameters 
     
    182184 
    183185class WidgetDescription(object): 
    184     """Description of a widget. 
     186    """ 
     187    Description of a widget. 
    185188 
    186189    Parameters 
     
    207210    project_name : str, optional 
    208211        The distribution name that provides the widget. 
    209     inputs : list of `InputSignal`, optional 
     212    inputs : list of :class:`InputSignal`, optional 
    210213        A list of input channels provided by the widget. 
    211     outputs : list of `OutputSignal`, optional 
     214    outputs : list of :class:`OutputSignal`, optional 
    212215        A list of output channels provided by the widget. 
    213216    help : str, optional 
     
    285288    @classmethod 
    286289    def from_file(cls, filename, import_name=None): 
    287         """Widget description from old style (2.5 version) widget 
     290        """ 
     291        Widget description from old style (2.5 version) widget 
    288292        descriptions. 
    289293 
     
    355359    @classmethod 
    356360    def from_module(cls, module): 
    357         """Get the widget description from a module. 
     361        """ 
     362        Get the widget description from a module. 
    358363 
    359364        The module is inspected for global variables (upper case versions of 
     
    449454 
    450455class CategoryDescription(object): 
    451     """Description of a widget category. 
     456    """ 
     457    Description of a widget category. 
    452458 
    453459    Parameters 
     
    456462    name : str 
    457463        A human readable name. 
    458     version : str 
    459         Version string (optional). 
    460     description : str 
    461         A short description of the category, suitable for a tool 
    462         tip (optional). 
    463     long_description : str 
     464    version : str, optional 
     465        Version string. 
     466    description : str, optional 
     467        A short description of the category, suitable for a tool tip. 
     468    long_description : str, optional 
    464469        A longer description. 
    465     qualified_name : str 
     470    qualified_name : str, 
    466471        Qualified name 
    467472    project_name : str 
     
    470475        Priority (order in the GUI). 
    471476    icon : str 
    472         An icon filename 
     477        An icon filename (a resource name retrievable using `pkg_resources` 
     478        relative to `qualified_name`). 
    473479    background : str 
    474480        An background color for widgets in this category. 
     
    512518    @classmethod 
    513519    def from_package(cls, package): 
    514         """Get the CategoryDescription from a package. 
     520        """ 
     521        Get the CategoryDescription from a package. 
    515522 
    516523        Parameters 
Note: See TracChangeset for help on using the changeset viewer.