[orca] Make detailed whereAmI fall back on basic whereAmI
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Make detailed whereAmI fall back on basic whereAmI
- Date: Wed, 24 Feb 2016 15:59:11 +0000 (UTC)
commit 10e0e6eb82e51c7852741a03087010d61669b9aa
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Feb 24 10:58:11 2016 -0500
Make detailed whereAmI fall back on basic whereAmI
src/orca/formatting.py | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index c3f9ac7..76252d1 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -901,23 +901,28 @@ class Formatting(dict):
'focused', 'basicWhereAmI', etc.
"""
try:
- # First try to find the exact match.
- #
- format = self[args['mode']][args['role']][args['formatType']]
+ return self[args['mode']][args['role']][args['formatType']]
except:
+ pass
+
+ if args.get('formatType') == 'detailedWhereAmI':
try:
- # Failing that, fallback to the 'unfocused' formatType
- # for the mode and role, if it exists.
- #
- format = self[args['mode']][args['role']]['unfocused']
+ return self[args['mode']][args['role']]['basicWhereAmI']
except:
- try:
- # Failing that, fallback to the default for the
- # formatType
- #
- format = self[args['mode']]['default'][args['formatType']]
- except:
- # Failing that, just used the default 'unfocused' format
- #
- format = self[args['mode']]['default']['unfocused']
- return format
+ pass
+
+ try:
+ return self[args['mode']][args['role']]['unfocused']
+ except:
+ pass
+
+
+ try:
+ return self[args['mode']]['default'][args['formatType']]
+ except:
+ pass
+
+ try:
+ return self[args['mode']]['default']['unfocused']
+ except:
+ return []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]