Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-02-25 21:41:17 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-02-25 21:41:17 (GMT)
commiteaa52d04536ad0f871bd8ace179f5e368f179551 (patch)
treee728dad044e42aabfef6a2938cfbf32d79c408eb
parent059781b83e17f3cc9e93edbcd4c52f08738f0ccc (diff)
pylintify dialog a bit
-rw-r--r--src/sugar/tutorius/dialog.py24
-rw-r--r--src/sugar/tutorius/tutorial.py2
2 files changed, 22 insertions, 4 deletions
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()