Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/addons/gtkwidgettypefilter.py
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-12-04 22:25:14 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-04 22:27:21 (GMT)
commit9500e288397de5710151f32ced2e9a2903766a2e (patch)
tree17dd1765f9acf148faae4f70f6523e245ae5b463 /addons/gtkwidgettypefilter.py
parent9a44da4488a0ff00150eb5cb114f74ba560b96a6 (diff)
Boy scout : Fixing tests for properties' values
(cherry picked from commit 9f985564d6ade807a9182fcb7411388ed863e311)
Diffstat (limited to 'addons/gtkwidgettypefilter.py')
-rw-r--r--addons/gtkwidgettypefilter.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/gtkwidgettypefilter.py b/addons/gtkwidgettypefilter.py
index 8faf172..0339e74 100644
--- a/addons/gtkwidgettypefilter.py
+++ b/addons/gtkwidgettypefilter.py
@@ -15,7 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from ..filters import *
-from ..properties import *
+from ..properties import TStringProperty, TSequenceProperty
from ..services import ObjectStore
from ..gtkutils import find_widget
@@ -28,7 +28,7 @@ class GtkWidgetTypeFilter(EventFilter):
"""
object_id = TStringProperty("")
text = TStringProperty("")
- strokes = TArrayProperty([])
+ strokes = TSequenceProperty("")
def __init__(self, object_id, text=None, strokes=None):
"""Constructor
@@ -41,9 +41,9 @@ class GtkWidgetTypeFilter(EventFilter):
"""
super(GtkWidgetTypeFilter, self).__init__()
self.object_id = object_id
- self.text = text
+ self.text = text or ""
self._captext = ""
- self.strokes = strokes
+ self.strokes = strokes or []
self._capstrokes = []
self._widget = None
self._handler_id = None
@@ -86,9 +86,9 @@ class GtkWidgetTypeFilter(EventFilter):
self._captext = self._captext + keystr
logger.debug("~~~Current state: " + str(self._capstrokes) + ":" + str(self._captext))
- if not self.strokes is None and self.strokes in self._capstrokes:
+ if not self.strokes == [] and self.strokes in self._capstrokes:
self.do_callback()
- if not self.text is None and self.text in self._captext:
+ if not self.text is "" and self.text in self._captext:
self.do_callback()
__event__ = {