1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

Improved hscommon docs

TIL sphinx is rather smart about partial class refrences (starting with
a ".")
This commit is contained in:
Virgil Dupras 2013-11-30 12:29:25 -05:00
parent 5a275db67d
commit b6bc5de79c
3 changed files with 10 additions and 11 deletions

View File

@ -177,7 +177,7 @@ class GUISelectableList(SelectableList, GUIObject):
Represents a UI element presenting the user with a selectable list of items. Represents a UI element presenting the user with a selectable list of items.
Subclasses :class:`SelectableList` and :class:`~hscommon.gui.base.GUIObject`. Expected view: Subclasses :class:`SelectableList` and :class:`.GUIObject`. Expected view:
:class:`GUISelectableListView`. :class:`GUISelectableListView`.
:param iterable items: If specified, items to fill the list with initially. :param iterable items: If specified, items to fill the list with initially.

View File

@ -15,14 +15,14 @@ from .selectable_list import Selectable
class Table(MutableSequence, Selectable): class Table(MutableSequence, Selectable):
"""Sortable and selectable sequence of :class:`Row`. """Sortable and selectable sequence of :class:`Row`.
In fact, the Table is very similar to :class:`~hscommon.gui.selectable_list.SelectableList` in In fact, the Table is very similar to :class:`.SelectableList` in
practice and differs mostly in principle. Their difference lies in the nature of their items practice and differs mostly in principle. Their difference lies in the nature of their items
they manage. With the Table, rows usually have many properties, presented in columns, and they they manage. With the Table, rows usually have many properties, presented in columns, and they
have to subclass :class:`Row`. have to subclass :class:`Row`.
Usually used with :class:`~hscommon.gui.column.Column`. Usually used with :class:`~hscommon.gui.column.Column`.
Subclasses :class:`~hscommon.gui.selectable_list.Selectable`. Subclasses :class:`.Selectable`.
""" """
def __init__(self): def __init__(self):
Selectable.__init__(self) Selectable.__init__(self)
@ -178,7 +178,7 @@ class Table(MutableSequence, Selectable):
@property @property
def selected_row(self): def selected_row(self):
"""Selected row according to :attr:`~hscommon.gui.selectable_list.Selectable.selected_index`. """Selected row according to :attr:`.selected_index`.
:class:`Row`. *get/set*. :class:`Row`. *get/set*.
@ -196,7 +196,7 @@ class Table(MutableSequence, Selectable):
@property @property
def selected_rows(self): def selected_rows(self):
"""List of selected rows based on :attr:`~hscommon.gui.selectable_list.Selectable.selected_indexes`. """List of selected rows based on :attr:`.selected_indexes`.
List of :class:`Row`. *read-only*. List of :class:`Row`. *read-only*.
""" """
@ -246,12 +246,12 @@ class GUITable(Table, GUIObject):
table view. table view.
Behaves like the :class:`Table` which it subclasses, but is more focused on being the presenter Behaves like the :class:`Table` which it subclasses, but is more focused on being the presenter
of some model data to its :attr:`~hscommon.gui.base.GUIObject.view`. There's a :meth:`refresh` of some model data to its :attr:`.GUIObject.view`. There's a :meth:`refresh`
mechanism which ensures fresh data while preserving sorting order and selection. There's also an mechanism which ensures fresh data while preserving sorting order and selection. There's also an
editing mechanism which tracks whether (and which) row is being edited (or added) and editing mechanism which tracks whether (and which) row is being edited (or added) and
save/cancel edits when appropriate. save/cancel edits when appropriate.
Subclasses :class:`Table` and :class:`~hscommon.gui.base.GUIObject`. Expected view: Subclasses :class:`Table` and :class:`.GUIObject`. Expected view:
:class:`GUITableView`. :class:`GUITableView`.
""" """
def __init__(self): def __init__(self):
@ -298,8 +298,7 @@ class GUITable(Table, GUIObject):
many cases, such as in :meth:`refresh`, our selection will be lost. After the operation is many cases, such as in :meth:`refresh`, our selection will be lost. After the operation is
over, we call this method with our previously selected indexes (in ``previous_selection``). over, we call this method with our previously selected indexes (in ``previous_selection``).
The default behavior is (if we indeed have an empty The default behavior is (if we indeed have an empty :attr:`.selected_indexes`) to re-select
:attr:`~hscommon.gui.selectable_list.Selectable.selected_indexes`) to re-select
``previous_selection``. If it was empty, we select the last row of the table. ``previous_selection``. If it was empty, we select the last row of the table.
This behavior can, of course, be overriden. This behavior can, of course, be overriden.
@ -407,7 +406,7 @@ class GUITable(Table, GUIObject):
"""Sort table by ``column_name``. """Sort table by ``column_name``.
Overrides :meth:`Table.sort_by`. After having performed sorting, calls Overrides :meth:`Table.sort_by`. After having performed sorting, calls
:meth:`~hscommon.gui.selectable_list.Selectable._update_selection` to give you the chance, :meth:`~.Selectable._update_selection` to give you the chance,
if appropriate, to update your selected indexes according to, maybe, the selection that you if appropriate, to update your selected indexes according to, maybe, the selection that you
have in your model. have in your model.

View File

@ -32,7 +32,7 @@ class TextField(GUIObject):
When our model value isn't a string, we have a built-in parsing/formatting mechanism allowing When our model value isn't a string, we have a built-in parsing/formatting mechanism allowing
us to directly retrieve/set our non-string value through :attr:`value`. us to directly retrieve/set our non-string value through :attr:`value`.
Subclasses :class:`hscommon.gui.base.GUIObject`. Expected view: :class:`TextFieldView`. Subclasses :class:`.GUIObject`. Expected view: :class:`TextFieldView`.
""" """
def __init__(self): def __init__(self):
GUIObject.__init__(self) GUIObject.__init__(self)