From eaa52d04536ad0f871bd8ace179f5e368f179551 Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Wed, 25 Feb 2009 21:41:17 +0000 Subject: pylintify dialog a bit --- diff --git a/src/sugar/tutorius/dialog.py b/src/sugar/tutorius/dialog.py index 298800a..be51a0e 100644 --- a/src/sugar/tutorius/dialog.py +++ b/src/sugar/tutorius/dialog.py @@ -13,11 +13,27 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - +""" +The Dialog module provides means of interacting with the user +through the use of Dialogs. +""" import gtk class TutoriusDialog(gtk.Dialog): + """ + TutoriusDialog is a simple wrapper around gtk.Dialog. + + It allows creating and showing a dialog and connecting the response and + button click events to callbacks. + """ def __init__(self, label="Hint", button_clicked_cb=None, response_cb=None): + """ + Constructor. + + @param label text to be shown on the dialog + @param button_clicked_cb callback for the button click + @param response_cb callback for the dialog response + """ gtk.Dialog.__init__(self) self._button = gtk.Button(label) @@ -34,8 +50,10 @@ class TutoriusDialog(gtk.Dialog): self.set_decorated(False) - def setButtonClickedCallback(self, funct): + def set_button_clicked_cb(self, funct): + """Setter for the button_clicked callback""" self._button.connect("clicked", funct) - def closeSelf(self, Arg=None): + def close_self(self, arg=None): + """Close the dialog""" self.destroy() diff --git a/src/sugar/tutorius/tutorial.py b/src/sugar/tutorius/tutorial.py index 10af1d1..8919057 100644 --- a/src/sugar/tutorius/tutorial.py +++ b/src/sugar/tutorius/tutorial.py @@ -148,7 +148,7 @@ class Tutorial (object): if newstate.has_key("Message"): dlg = TutoriusDialog(newstate["Message"]) - dlg.setButtonClickedCallback(dlg.closeSelf) + dlg.set_button_clicked_cb(dlg.close_self) dlg.run() -- cgit v0.9.1