[orca] Removing even more ancient, unused debugging methods
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Removing even more ancient, unused debugging methods
- Date: Fri, 21 Dec 2012 19:18:39 +0000 (UTC)
commit 180f010515ef53e78d5f9ec8b16c4f71c9c18b6c
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Dec 21 20:18:04 2012 +0100
Removing even more ancient, unused debugging methods
src/orca/scripts/toolkits/Gecko/script.py | 99 -----------------------------
1 files changed, 0 insertions(+), 99 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 4fcc481..24d188c 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -2481,105 +2481,6 @@ class Script(default.Script):
####################################################################
# #
- # Methods for debugging. #
- # #
- ####################################################################
-
- def outlineExtents(self, obj, startOffset, endOffset):
- """Draws an outline around the given text for the object or the entire
- object if it has no text. This is for debug purposes only.
-
- Arguments:
- -obj: the object
- -startOffset: character offset to start at
- -endOffset: character offset just after last character to end at
- """
- [x, y, width, height] = self.getExtents(obj, startOffset, endOffset)
- self.drawOutline(x, y, width, height)
-
- def dumpInfo(self, obj):
- """Dumps the parental hierachy info of obj to stdout."""
-
- if obj.parent:
- self.dumpInfo(obj.parent)
-
- print("---")
- text = self.utilities.queryNonEmptyText(obj)
- if text and obj.getRole() != pyatspi.ROLE_DOCUMENT_FRAME:
- string = text.getText(0, -1)
- else:
- string = ""
- print(obj, obj.name, obj.getRole(), \
- obj.accessible.getIndexInParent(), string)
- offset = self.utilities.characterOffsetInParent(obj)
- if offset >= 0:
- print(" offset =", offset)
-
- def getDocumentContents(self):
- """Returns an ordered list where each element is composed of
- an [obj, startOffset, endOffset] tuple. The list is created
- via an in-order traversal of the document contents starting at
- the current caret context (or the beginning of the document if
- there is no caret context).
-
- WARNING: THIS TRAVERSES A LARGE PART OF THE DOCUMENT AND IS
- INTENDED PRIMARILY FOR DEBUGGING PURPOSES ONLY."""
-
- contents = []
- lastObj = None
- lastExtents = None
- self.clearCaretContext()
- [obj, characterOffset] = self.getCaretContext()
- while obj:
- if True or obj.getState().contains(pyatspi.STATE_SHOWING):
- if self.utilities.queryNonEmptyText(obj):
- # Check for text being on a different line. Gecko
- # gives us odd character extents sometimes, so we
- # defensively ignore those.
- #
- characterExtents = self.getExtents(
- obj, characterOffset, characterOffset + 1)
- if characterExtents != (0, 0, 0, 0):
- if lastExtents \
- and not self.onSameLine(lastExtents,
- characterExtents):
- contents.append([None, -1, -1])
- lastExtents = characterExtents
-
- # Check to see if we've moved across objects or are
- # still on the same object. If we've moved, we want
- # to add another context. If we're still on the same
- # object, we just want to update the end offset.
- #
- if (len(contents) == 0) or (obj != lastObj):
- contents.append([obj,
- characterOffset,
- characterOffset + 1])
- else:
- [currentObj, startOffset, endOffset] = contents[-1]
- if characterOffset == endOffset:
- contents[-1] = [currentObj, # obj
- startOffset, # startOffset
- endOffset + 1] # endOffset
- else:
- contents.append([obj,
- characterOffset,
- characterOffset + 1])
- else:
- # Some objects present text and/or something visual
- # (e.g., a checkbox), so we want to track it.
- #
- contents.append([obj, -1, -1])
-
- lastObj = obj
-
- [obj, characterOffset] = self.findNextCaretInOrder(obj,
- characterOffset)
-
- return contents
-
- ####################################################################
- # #
# Utility Methods #
# #
####################################################################
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]