[orca/570658] updated evolution script, speech_generator, added in formatting.py.
- From: Mesar Hameed <mhameed src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca/570658] updated evolution script, speech_generator, added in formatting.py.
- Date: Thu, 14 May 2009 15:13:10 -0400 (EDT)
commit ff17d888f02c28eb47b0c5c34e085d64015367e3
Author: Mesar Hameed <mhameed src gnome org>
Date: Thu May 14 20:12:56 2009 +0100
updated evolution script, speech_generator, added in formatting.py.
---
src/orca/scripts/apps/evolution/Makefile.am | 9 ++--
src/orca/scripts/apps/evolution/formatting.py | 58 ++++++++++++++++++++
src/orca/scripts/apps/evolution/script.py | 5 ++
.../scripts/apps/evolution/speech_generator.py | 25 ++-------
4 files changed, 72 insertions(+), 25 deletions(-)
diff --git a/src/orca/scripts/apps/evolution/Makefile.am b/src/orca/scripts/apps/evolution/Makefile.am
old mode 100644
new mode 100755
index 9a00a0b..1ca5519
--- a/src/orca/scripts/apps/evolution/Makefile.am
+++ b/src/orca/scripts/apps/evolution/Makefile.am
@@ -1,10 +1,11 @@
orca_pathdir=$(pyexecdir)
orca_python_PYTHON = \
- __init__.py \
- script.py \
- speech_generator.py \
- where_am_i.py
+ __init__.py \
+ formatting.py \
+ script.py \
+ speech_generator.py \
+ where_am_i.py
orca_pythondir=$(pyexecdir)/orca/scripts/apps/evolution
diff --git a/src/orca/scripts/apps/evolution/formatting.py b/src/orca/scripts/apps/evolution/formatting.py
new file mode 100755
index 0000000..40a6d95
--- /dev/null
+++ b/src/orca/scripts/apps/evolution/formatting.py
@@ -0,0 +1,58 @@
+# Orca
+#
+# Copyright 2006-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Custom formatting for evolution."""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import pyatspi
+
+import orca.formatting as defaultFormatting
+
+scriptFormatting = {
+ 'speech': {
+ 'REAL_ROLE_TABLE_CELL': {
+ # the real cell information
+ # note that pyatspi.ROLE_TABLE_CELL is used to work out if we need to
+ # read a whole row. It calls REAL_ROLE_TABLE_CELL internally.
+ #
+ 'focused': '(isDesiredFocusedItem and ' \
+ '(tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState )) + required)' \
+ ' or ((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)',
+ 'unfocused': '(isDesiredFocusedItem ' \
+ ' and ' \
+ '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription ' \
+ ' + image) + (expandableState and (expandableState + numberOfChildren)) + required)' \
+ ') or ' \
+ '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription ' \
+ ' + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
+ },
+ }
+}
+
+class Formatting(defaultFormatting.Formatting):
+
+ def __init__(self, script):
+ defaultFormatting.Formatting.__init__(self, script)
+ self.update(scriptFormatting)
+
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
old mode 100644
new mode 100755
index 5f626fe..abada76
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -43,6 +43,7 @@ from orca.orca_i18n import _ # for gettext support
from where_am_i import WhereAmI
from speech_generator import SpeechGenerator
+from formatting import Formatting
########################################################################
# #
# The Evolution script class. #
@@ -145,6 +146,10 @@ class Script(default.Script):
return WhereAmI(self)
+ def getFormatting(self):
+ """Returns the formatting strings for this script."""
+ return Formatting(self)
+
def setupInputEventHandlers(self):
"""Defines InputEventHandler fields for this script that can be
called by the key and braille bindings. In this particular case,
diff --git a/src/orca/scripts/apps/evolution/speech_generator.py b/src/orca/scripts/apps/evolution/speech_generator.py
old mode 100644
new mode 100755
index aa0bbb1..026a68b
--- a/src/orca/scripts/apps/evolution/speech_generator.py
+++ b/src/orca/scripts/apps/evolution/speech_generator.py
@@ -37,19 +37,7 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
def __init__(self, script):
speechgenerator.SpeechGenerator.__init__(self, script)
- def _getSpeechForTableCell(self, obj, already_focused):
- """Get the speech utterances for a single table cell
-
- Arguments:
- - obj: the table
- - already_focused: False if object just received focus
-
- Returns a list of utterances to be spoken for the object.
- """
-
- utterances = speechgenerator.SpeechGenerator.\
- _getSpeechForTableCell(self, obj, already_focused)
-
+ def _getIsDesiredFocusedItem(self, obj, already_focused):
# Check that we are in a table cell in the mail message header list.
# If we are and this table cell has an expanded state, and the first
# token of the last utterances is "0", then strip off that last
@@ -59,11 +47,6 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
pyatspi.ROLE_TREE_TABLE, \
pyatspi.ROLE_UNKNOWN]
if self._script.isDesiredFocusedItem(obj, rolesList):
- state = obj.getState()
- if state and state.contains(pyatspi.STATE_EXPANDABLE):
- if state.contains(pyatspi.STATE_EXPANDED):
- tokens = utterances[-1].split()
- if tokens[0] == "0":
- utterances = utterances[0:-1]
-
- return utterances
+ return True
+ else:
+ return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]