[orca/570658-whereami] Turn already_focused into alreadyFocused
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca/570658-whereami] Turn already_focused into alreadyFocused
- Date: Wed, 3 Jun 2009 12:58:18 -0400 (EDT)
commit faf30d35e16e816734b1604580a899d6515f6161
Author: Willie Walker <william walker sun com>
Date: Wed Jun 3 12:56:54 2009 -0400
Turn already_focused into alreadyFocused
---
src/orca/default.py | 6 +-
src/orca/formatting.py | 12 +-
src/orca/scripts/apps/gedit/script.py | 2 +-
src/orca/scripts/apps/soffice/speech_generator.py | 6 +-
src/orca/speech_generator.py | 4 +-
src/orca/tutorialgenerator.py | 150 ++++++++++----------
src/orca/where_am_I.py | 2 +-
7 files changed, 90 insertions(+), 92 deletions(-)
diff --git a/src/orca/default.py b/src/orca/default.py
index b09b849..153c338 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -3032,7 +3032,7 @@ class Script(script.Script):
if target == orca_state.locusOfFocus:
self.updateBraille(target)
utterances = self.speechGenerator.getSpeech(
- target, already_focused=True)
+ target, alreadyFocused=True)
utterances.extend(self.tutorialGenerator.getTutorial(
target, True))
speech.speak(utterances)
@@ -3051,7 +3051,7 @@ class Script(script.Script):
if target == orca_state.locusOfFocus:
self.updateBraille(target)
utterances = self.speechGenerator.getSpeech(
- target, already_focused=True)
+ target, alreadyFocused=True)
utterances.extend(self.tutorialGenerator.getTutorial(
target, True))
speech.speak(utterances)
@@ -3085,7 +3085,7 @@ class Script(script.Script):
mag.magnifyAccessible(event, obj)
self.updateBraille(obj)
- utterances = self.speechGenerator.getSpeech(obj, already_focused=True)
+ utterances = self.speechGenerator.getSpeech(obj, alreadyFocused=True)
utterances.extend(self.tutorialGenerator.getTutorial(obj, True))
speech.speak(utterances)
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index 4cda2b4..45ca67f 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -250,8 +250,8 @@ class Formatting(dict):
self[key] = val
def getPrefix(self, mode, **args):
- already_focused = args.get('already_focused', False)
- if already_focused:
+ alreadyFocused = args.get('alreadyFocused', False)
+ if alreadyFocused:
# TODO - JD: This seems rather silly/hacky.
#
where_am_i_type = args.get('where_am_i_type', None)
@@ -270,8 +270,8 @@ class Formatting(dict):
return prefix
def getSuffix(self, mode, **args):
- already_focused = args.get('already_focused', False)
- if already_focused:
+ alreadyFocused = args.get('alreadyFocused', False)
+ if alreadyFocused:
# TODO - JD: This seems rather silly/hacky.
#
where_am_i_type = args.get('where_am_i_type', None)
@@ -290,8 +290,8 @@ class Formatting(dict):
return suffix
def getFormat(self, mode, **args):
- already_focused = args.get('already_focused', False)
- if already_focused:
+ alreadyFocused = args.get('alreadyFocused', False)
+ if alreadyFocused:
# TODO - JD: This seems rather silly/hacky.
#
where_am_i_type = args.get('where_am_i_type', None)
diff --git a/src/orca/scripts/apps/gedit/script.py b/src/orca/scripts/apps/gedit/script.py
index 1c3c659..091957d 100644
--- a/src/orca/scripts/apps/gedit/script.py
+++ b/src/orca/scripts/apps/gedit/script.py
@@ -571,7 +571,7 @@ class Script(default.Script):
#
speech.speak(_("Phrase found."))
utterances = self.speechGenerator.getSpeech(
- event.source, already_focused=True)
+ event.source, alreadyFocused=True)
speech.speak(utterances)
# If Ctrl+G was used to repeat a find command, speak the line that
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py b/src/orca/scripts/apps/soffice/speech_generator.py
index 7a3ae41..1792bb5 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -98,8 +98,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
# parent as part of the speech context and do not want
# to repeat it.
#
- already_focused = args.get('already_focused', False)
- if already_focused:
+ alreadyFocused = args.get('alreadyFocused', False)
+ if alreadyFocused:
result.extend(parentLabel)
# If we still don't have a label, look to the name.
#
@@ -236,7 +236,6 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
Arguments:
- obj: the table cell
- - already_focused: False if object just received focus
Returns a list of utterances to be spoken for the object.
"""
@@ -267,7 +266,6 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
Arguments:
- obj: the table cell
- - already_focused: False if object just received focus
Returns a list of utterances to be spoken for the object.
"""
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index ac18489..a6282a6 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1819,11 +1819,11 @@ class SpeechGenerator:
tutorial generator. A tutorial can be forced by setting the
'forceTutorial' attribute of the args dictionary to True.
"""
- already_focused = args.get('already_focused', False)
+ alreadyFocused = args.get('alreadyFocused', False)
forceTutorial = args.get('forceTutorial', False)
return self._script.tutorialGenerator.getTutorial(
obj,
- already_focused,
+ alreadyFocused,
forceTutorial)
#####################################################################
diff --git a/src/orca/tutorialgenerator.py b/src/orca/tutorialgenerator.py
index e958182..a5e31f9 100644
--- a/src/orca/tutorialgenerator.py
+++ b/src/orca/tutorialgenerator.py
@@ -99,14 +99,14 @@ class TutorialGenerator:
self.tutorialGenerators[pyatspi.ROLE_SLIDER] = \
self._getTutorialForSlider
- def _debugGenerator(self, generatorName, obj, already_focused, utterances):
+ def _debugGenerator(self, generatorName, obj, alreadyFocused, utterances):
"""Prints debug.LEVEL_FINER information regarding
the tutorial generator.
Arguments:
- generatorName: the name of the generator
- obj: the object being presented
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- utterances: the generated text
"""
@@ -117,7 +117,7 @@ class TutorialGenerator:
debug.println(debug.LEVEL_FINER,
" role = %s" % obj.getRoleName())
debug.println(debug.LEVEL_FINER,
- " already_focused = %s" % already_focused)
+ " alreadyFocused = %s" % alreadyFocused)
debug.println(debug.LEVEL_FINER,
" utterances:")
for text in utterances:
@@ -125,13 +125,13 @@ class TutorialGenerator:
" (%s)" % text)
def _getDefaultTutorial(
- self, obj, already_focused, forceTutorial, role=None):
+ self, obj, alreadyFocused, forceTutorial, role=None):
"""The default tutorial generator returns the empty tutorial string
because We have no associated tutorial function for the object.
Arguments:
- obj: an Accessible
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
- role: A role that should be used instead of the Accessible's
possible role.
@@ -142,12 +142,12 @@ class TutorialGenerator:
return []
- def _getTutorialForCheckBox(self, obj, already_focused, forceTutorial):
+ def _getTutorialForCheckBox(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a check box.
Arguments:
- obj: the check box
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -157,23 +157,23 @@ class TutorialGenerator:
# Translators: this is a tip for the user on how to toggle a checkbox.
msg = _("Press space to toggle.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForCheckBox",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForComboBox(self, obj, already_focused, forceTutorial):
+ def _getTutorialForComboBox(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a combobox.
Arguments:
- obj: the combo box
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -184,23 +184,23 @@ class TutorialGenerator:
# with a combobox.
msg = _("Press space to expand, and use up and down to select an item.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForComboBox",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForFrame(self, obj, already_focused, forceTutorial):
+ def _getTutorialForFrame(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a frame.
Arguments:
- obj: the frame
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -224,17 +224,17 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForFrame",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForIcon(self, obj, already_focused, forceTutorial):
+ def _getTutorialForIcon(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for an icon.
Arguments:
- obj: the icon
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -242,26 +242,26 @@ class TutorialGenerator:
if obj.parent.getRole() == pyatspi.ROLE_LAYERED_PANE:
utterances = self._getTutorialForLayeredPane(obj.parent,
- already_focused,
+ alreadyFocused,
forceTutorial)
else:
utterances = self._getDefaultTutorial(obj,
- already_focused,
+ alreadyFocused,
forceTutorial)
self._debugGenerator("_getTutorialForIcon",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForLayeredPane(self, obj, already_focused, forceTutorial):
+ def _getTutorialForLayeredPane(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a layered pane.
Arguments:
- obj: the layered pane
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -287,7 +287,7 @@ class TutorialGenerator:
if 'nautilus' in scriptName and obj == sibling:
utterances.append(desktopMsg)
- if (not already_focused and self.lastTutorial != utterances) \
+ if (not alreadyFocused and self.lastTutorial != utterances) \
or forceTutorial:
pass
else:
@@ -295,17 +295,17 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForLayeredPane",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForList(self, obj, already_focused, forceTutorial):
+ def _getTutorialForList(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a list.
Arguments:
- obj: the list
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -316,23 +316,23 @@ class TutorialGenerator:
# Translators: this is the tutorial string when navigating lists.
msg = _("Use up and down to select an item.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForList",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForListItem(self, obj, already_focused, forceTutorial):
+ def _getTutorialForListItem(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a listItem.
Arguments:
- obj: the listitem
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -365,16 +365,16 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForListItem",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForText(self, obj, already_focused, forceTutorial):
+ def _getTutorialForText(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a text object.
Arguments:
- obj: the text component
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -384,23 +384,23 @@ class TutorialGenerator:
# on text fields.
msg = _("Type in text.")
- if (not already_focused or forceTutorial) and \
+ if (not alreadyFocused or forceTutorial) and \
not self._script.isReadOnlyTextArea(obj):
utterances.append(msg)
self._debugGenerator("_getTutorialForText",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForPageTab(self, obj, already_focused, forceTutorial):
+ def _getTutorialForPageTab(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a page tab.
Arguments:
- obj: the page tab
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of tutorial utterances to be spoken for the object.
@@ -417,17 +417,17 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForPageTabList",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForPushButton(self, obj, already_focused, forceTutorial):
+ def _getTutorialForPushButton(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a push button
Arguments:
- obj: the push button
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -437,24 +437,24 @@ class TutorialGenerator:
# Translators: this is the tutorial string for activating a push button.
msg = _("To activate press space.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForPushButton",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForSpinButton(self, obj, already_focused, forceTutorial):
+ def _getTutorialForSpinButton(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a spin button. If the object already has
focus, then no tutorial is given.
Arguments:
- obj: the spin button
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -466,23 +466,23 @@ class TutorialGenerator:
msg = _("Use up or down arrow to select value." \
" Or type in the desired numerical value.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForSpinButton",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForTableCell(self, obj, already_focused, forceTutorial):
+ def _getTutorialForTableCell(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial utterances for a single table cell
Arguments:
- obj: the table
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -536,12 +536,12 @@ class TutorialGenerator:
# Don't speak the label if just the checkbox state has
# changed.
#
- if already_focused and not hasToggle[i]:
+ if alreadyFocused and not hasToggle[i]:
pass
else:
utterances.extend( \
self._getTutorialForTableCell(obj[i],
- already_focused, forceTutorial))
+ alreadyFocused, forceTutorial))
return utterances
# [[[TODO: WDW - Attempt to infer the cell type. There's a
@@ -565,7 +565,7 @@ class TutorialGenerator:
#
if action.getName(i) in ["toggle", _("toggle")]:
utterances = self._getTutorialForCheckBox(obj,
- already_focused, forceTutorial)
+ alreadyFocused, forceTutorial)
break
state = obj.getState()
@@ -579,17 +579,17 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForTableCell",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForTableCellRow(self, obj, already_focused, forceTutorial):
+ def _getTutorialForTableCellRow(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for the active table cell in the table row.
Arguments:
- obj: the table
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -597,7 +597,7 @@ class TutorialGenerator:
utterances = []
- if (not already_focused):
+ if (not alreadyFocused):
try:
parent_table = obj.parent.queryTable()
except NotImplementedError:
@@ -623,27 +623,27 @@ class TutorialGenerator:
pointOfReference["lastColumn"] == column)
utterances.extend(self._getTutorialForTableCell(obj,
- already_focused, forceTutorial))
+ alreadyFocused, forceTutorial))
else:
utterances = self._getTutorialForTableCell(obj,
- already_focused, forceTutorial)
+ alreadyFocused, forceTutorial)
else:
- utterances = self._getTutorialForTableCell(obj, already_focused, \
+ utterances = self._getTutorialForTableCell(obj, alreadyFocused, \
forceTutorial)
self._debugGenerator("_getTutorialForTableCellRow",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForRadioButton(self, obj, already_focused, forceTutorial):
+ def _getTutorialForRadioButton(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a radio button.
Arguments:
- obj: the radio button
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -653,22 +653,22 @@ class TutorialGenerator:
# Translators: this is a tip for the user, how to navigate radiobuttons.
msg = _("Use arrow keys to change.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForRadioButton",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForMenu(self, obj, already_focused, forceTutorial):
+ def _getTutorialForMenu(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a menu.
Arguments:
- obj: the menu
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -694,17 +694,17 @@ class TutorialGenerator:
self._debugGenerator("_getTutorialForMenu",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def _getTutorialForSlider(self, obj, already_focused, forceTutorial):
+ def _getTutorialForSlider(self, obj, alreadyFocused, forceTutorial):
"""Get the tutorial string for a slider. If the object already has
focus, then no tutorial is given.
Arguments:
- obj: the slider
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken for the object.
@@ -716,18 +716,18 @@ class TutorialGenerator:
msg = _("To decrease press left arrow, to increase press right arrow." \
" To go to minimum press home, and for maximum press end.")
- if (not already_focused and self.lastTutorial != [msg]) \
+ if (not alreadyFocused and self.lastTutorial != [msg]) \
or forceTutorial:
utterances.append(msg)
self._debugGenerator("_getTutorialForSlider",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
- def getTutorial(self, obj, already_focused, forceTutorial=False):
+ def getTutorial(self, obj, alreadyFocused, forceTutorial=False):
"""Get the tutorial for an Accessible object. This will look
first to the specific tutorial generators and if this
does not exist then return the empty tutorial.
@@ -736,7 +736,7 @@ class TutorialGenerator:
Arguments:
- obj: the object
- - already_focused: False if object just received focus
+ - alreadyFocused: False if object just received focus
- forceTutorial: used for when whereAmI really needs the tutorial string
Returns a list of utterances to be spoken.
@@ -750,7 +750,7 @@ class TutorialGenerator:
generator = self.tutorialGenerators[role]
else:
generator = self._getDefaultTutorial
- msg = generator(obj, already_focused, forceTutorial)
+ msg = generator(obj, alreadyFocused, forceTutorial)
utterances = [" ".join(msg)]
if msg:
self.lastTutorial = msg
@@ -759,6 +759,6 @@ class TutorialGenerator:
self._debugGenerator("getTutorial",
obj,
- already_focused,
+ alreadyFocused,
utterances)
return utterances
diff --git a/src/orca/where_am_I.py b/src/orca/where_am_I.py
index 4325e90..30fc947 100644
--- a/src/orca/where_am_I.py
+++ b/src/orca/where_am_I.py
@@ -576,7 +576,7 @@ class WhereAmI:
#
return self._script.speechGenerator.\
getSpeech(obj,
- already_focused = True,
+ alreadyFocused = True,
where_am_i_type = basicOnly,
forceMnemonic=True,
forceTutorial=True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]