[gnome-music/wip/mschraal/minor-searchbar-cleanup: 5/6] searchbar: Add docstrings



commit 2a193206a76ed179f2da6708ce6f30c32bf38b78
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Aug 13 15:42:50 2018 +0200

    searchbar: Add docstrings

 gnomemusic/searchbar.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/gnomemusic/searchbar.py b/gnomemusic/searchbar.py
index 37906c23..a49be8f7 100644
--- a/gnomemusic/searchbar.py
+++ b/gnomemusic/searchbar.py
@@ -283,6 +283,8 @@ class DropDown(Gtk.Revealer):
 
 
 class Searchbar(Gtk.SearchBar):
+    """Widget containing the search entry
+    """
 
     __gtype_name__ = 'Searchbar'
 
@@ -291,6 +293,11 @@ class Searchbar(Gtk.SearchBar):
 
     @log
     def __init__(self, stack_switcher):
+        """Initialize the Searchbar
+
+        :param Gtk.Stack stack_switcher: The stack switcher containing
+          the search view.
+        """
         super().__init__()
 
         self._timeout = None
@@ -364,6 +371,11 @@ class Searchbar(Gtk.SearchBar):
 
     @log
     def reveal(self, show, clear=True):
+        """Hides or reveals the searchbar
+
+        :param bool show: Whether to show the searchbar
+        :param bool clear: Whether to clear the search entry
+        """
         self.props.search_mode_enabled = show
 
         if show:
@@ -376,4 +388,5 @@ class Searchbar(Gtk.SearchBar):
 
     @log
     def toggle(self):
+        """Toggle the searchbar showing"""
         self.reveal(not self.get_search_mode())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]