[ocrfeeder] Make the getTextFromBoxes function consider text type boxes only
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Make the getTextFromBoxes function consider text type boxes only
- Date: Sat, 12 Mar 2011 12:19:04 +0000 (UTC)
commit 23e94986f4093730140c30a7360a30484878f7d6
Author: Joaquim Rocha <jrocha igalia com>
Date: Sat Mar 12 12:48:44 2011 +0100
Make the getTextFromBoxes function consider text type boxes only
src/ocrfeeder/studio/widgetModeler.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/studio/widgetModeler.py b/src/ocrfeeder/studio/widgetModeler.py
index e7804d6..554198e 100644
--- a/src/ocrfeeder/studio/widgetModeler.py
+++ b/src/ocrfeeder/studio/widgetModeler.py
@@ -311,13 +311,17 @@ class ImageReviewer:
number_of_boxes = len(boxes)
for i in range(number_of_boxes):
box = boxes[i]
- text += self.__getEditorFromBox(box).box_editor.getText()
+ box_editor = self.__getEditorFromBox(box).box_editor
+ if box_editor.getType() != TEXT_TYPE:
+ continue
+ text += box_editor.getText()
if number_of_boxes > 1 and i < number_of_boxes - 1:
text += '\n\n'
else:
current_box_editor = self.boxeditor_notebook.get_nth_page(\
self.boxeditor_notebook.get_current_page())
- text = current_box_editor.getText()
+ if current_box_editor.getType() == TEXT_TYPE:
+ text = current_box_editor.getText()
return text
def copyTextToClipboard(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]