From 88013b2f9f93c3220812cd3b624db1423ac081ed Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Mon, 19 Oct 2009 17:13:52 +0000 Subject: apply code review induced fixes, fix a few discovered bugs, enjoy, rinse and repeat --- (limited to 'addons') diff --git a/addons/bubblemessage.py b/addons/bubblemessage.py index a859ef8..b8f7405 100644 --- a/addons/bubblemessage.py +++ b/addons/bubblemessage.py @@ -18,9 +18,9 @@ from sugar.tutorius.actions import * class BubbleMessage(Action): message = TStringProperty("Message") # Create the position as an array of fixed-size 2 - position = TArrayProperty([0,0], 2, 2) + position = TArrayProperty((0,0), 2, 2) # Do the same for the tail position - tail_pos = TArrayProperty([0,0], 2, 2) + tail_pos = TArrayProperty((0,0), 2, 2) def __init__(self, message=None, pos=None, speaker=None, tailpos=None): """ @@ -94,7 +94,7 @@ class BubbleMessage(Action): def exit_editmode(self, *args): x,y = self._drag.position - self.position = [int(x), int(y)] + self.position = (int(x), int(y)) if self._drag: self._drag.draggable = False self._drag = None diff --git a/addons/dialogmessage.py b/addons/dialogmessage.py index 22a223b..bdd4bc3 100644 --- a/addons/dialogmessage.py +++ b/addons/dialogmessage.py @@ -20,7 +20,7 @@ from sugar.tutorius.actions import * class DialogMessage(Action): message = TStringProperty("Message") - position = TArrayProperty([0, 0], 2, 2) + position = TArrayProperty((0, 0), 2, 2) def __init__(self, message=None, pos=None): """ diff --git a/addons/gtkwidgeteventfilter.py b/addons/gtkwidgeteventfilter.py index f5bd0de..5497af4 100644 --- a/addons/gtkwidgeteventfilter.py +++ b/addons/gtkwidgeteventfilter.py @@ -13,8 +13,8 @@ # 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 -from sugar.tutorius.filters import * -from sugar.tutorius.properties import * +from sugar.tutorius.filters import EventFilter +from sugar.tutorius.properties import TUAMProperty, TStringProperty from sugar.tutorius.gtkutils import find_widget class GtkWidgetEventFilter(EventFilter): diff --git a/addons/readfile.py b/addons/readfile.py index 4aa054e..0d276b9 100644 --- a/addons/readfile.py +++ b/addons/readfile.py @@ -25,7 +25,8 @@ class ReadFile(Action): def __init__(self, filename=None): """ - Calls activity.read_file to load a specified state + Calls activity.read_file to restore a specified state to an activity + like when restored from the journal. @param filename Path to the file to read """ Action.__init__(self) -- cgit v0.9.1