[orca/570658] Delt with gnome-window-properties's speech_generator.
- From: Mesar Hameed <mhameed src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca/570658] Delt with gnome-window-properties's speech_generator.
- Date: Thu, 14 May 2009 13:07:53 -0400 (EDT)
commit e9ecd3028437534d19fd302d6ea2e2b30a349873
Author: Mesar Hameed <mhameed src gnome org>
Date: Thu May 14 18:05:24 2009 +0100
Delt with gnome-window-properties's speech_generator.
---
.../apps/gnome-window-properties/Makefile.am | 6 +-
.../apps/gnome-window-properties/formatting.py | 5 +-
.../scripts/apps/gnome-window-properties/script.py | 9 +--
.../gnome-window-properties/speech_generator.py | 59 --------------------
4 files changed, 8 insertions(+), 71 deletions(-)
diff --git a/src/orca/scripts/apps/gnome-window-properties/Makefile.am b/src/orca/scripts/apps/gnome-window-properties/Makefile.am
old mode 100644
new mode 100755
index c19b657..e8612ee
--- a/src/orca/scripts/apps/gnome-window-properties/Makefile.am
+++ b/src/orca/scripts/apps/gnome-window-properties/Makefile.am
@@ -1,9 +1,9 @@
orca_pathdir=$(pyexecdir)
orca_python_PYTHON = \
- __init__.py \
- script.py \
- speech_generator.py
+ __init__.py \
+ script.py \
+ formatting.py
orca_pythondir=$(pyexecdir)/orca/scripts/apps/gnome-window-properties
diff --git a/src/orca/scripts/apps/gnome-window-properties/formatting.py b/src/orca/scripts/apps/gnome-window-properties/formatting.py
index 7950be4..c92c596 100755
--- a/src/orca/scripts/apps/gnome-window-properties/formatting.py
+++ b/src/orca/scripts/apps/gnome-window-properties/formatting.py
@@ -32,7 +32,7 @@ import orca.formatting as defaultFormatting
scriptFormatting = {
'speech': {
pyatspi.ROLE_ALERT: {
- 'unfocused': 'foobar + unrelatedLabels'
+ 'unfocused': 'labelAndName + roleName '
},
}
}
@@ -43,6 +43,3 @@ class Formatting(defaultFormatting.Formatting):
defaultFormatting.Formatting.__init__(self, script)
self.update(scriptFormatting)
-
-f = Formatting(None)
-print f
diff --git a/src/orca/scripts/apps/gnome-window-properties/script.py b/src/orca/scripts/apps/gnome-window-properties/script.py
old mode 100644
new mode 100755
index b892a46..99a0413
--- a/src/orca/scripts/apps/gnome-window-properties/script.py
+++ b/src/orca/scripts/apps/gnome-window-properties/script.py
@@ -27,7 +27,7 @@ __license__ = "LGPL"
import orca.default as default
-from speech_generator import SpeechGenerator
+from formatting import Formatting
########################################################################
# #
@@ -46,7 +46,6 @@ class Script(default.Script):
"""
default.Script.__init__(self, app)
- def getSpeechGenerator(self):
- """Returns the speech generator for this script.
- """
- return SpeechGenerator(self)
+ def getFormatting(self):
+ """Returns the formatting strings for this script."""
+ return Formatting(self)
diff --git a/src/orca/scripts/apps/gnome-window-properties/speech_generator.py b/src/orca/scripts/apps/gnome-window-properties/speech_generator.py
deleted file mode 100644
index 65bb180..0000000
--- a/src/orca/scripts/apps/gnome-window-properties/speech_generator.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# 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 script for gnome-window-properties."""
-
-__id__ = "$Id$"
-__version__ = "$Revision$"
-__date__ = "$Date$"
-__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
-__license__ = "LGPL"
-
-import orca.speechgenerator as speechgenerator
-
-class SpeechGenerator(speechgenerator.SpeechGenerator):
- """Overrides _getSpeechForFrame so as to avoid digging into the
- gedit hierarchy and tickling a bug in gedit.
- """
- def __init__(self, script):
- speechgenerator.SpeechGenerator.__init__(self, script)
-
- def _getSpeechForAlert(self, obj, already_focused):
- """Gets the title of the dialog. Do NOT get the contents
- of labels inside the dialog that are not associated with any
- other objects.
-
- Arguments:
- - obj: the Accessible dialog
- - already_focused: False if object just received focus
-
- Returns a list of utterances be spoken.
- """
-
- utterances = []
- utterances.extend(self._getSpeechForObjectLabel(obj))
- utterances.extend(self._getSpeechForObjectName(obj))
- utterances.extend(self.getSpeechForObjectRole(obj))
-
- self._debugGenerator("gnome-window-properties._getSpeechForAlert",
- obj,
- already_focused,
- utterances)
-
- return utterances
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]