[ocrfeeder] Add the deskew images setting to the configuration manager



commit 306e1b73a6a1ecdca10f9a3c07c748e1800bf204
Author: Joaquim Rocha <jrocha igalia com>
Date:   Tue Jul 20 17:35:58 2010 +0200

    Add the deskew images setting to the configuration manager

 studio/configuration.py |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/studio/configuration.py b/studio/configuration.py
index 2b3003d..564a448 100644
--- a/studio/configuration.py
+++ b/studio/configuration.py
@@ -267,6 +267,7 @@ class ConfigurationManager(object):
     CLEAN_TEXT = 'clean_text'
     ADJUST_BOXES_BOUNDS = 'adjust_boxes_bounds'
     BOUNDS_ADJUSTMENT_SIZE = 'bounds_adjustment_size'
+    DESKEW_IMAGES_AFTER_ADDITION = 'deskew_images_after_addition'
 
     DEFAULTS = {TEMPORARY_DIR: '/tmp',
                 TEXT_FILL: (94, 156, 235, 150),
@@ -279,7 +280,8 @@ class ConfigurationManager(object):
                 COLUMN_MIN_WIDTH: 'auto',
                 CLEAN_TEXT: True,
                 ADJUST_BOXES_BOUNDS: True,
-                BOUNDS_ADJUSTMENT_SIZE: 'auto'
+                BOUNDS_ADJUSTMENT_SIZE: 'auto',
+                DESKEW_IMAGES_AFTER_ADDITION: True
                 }
 
     conf = dict(DEFAULTS)
@@ -415,6 +417,14 @@ class ConfigurationManager(object):
         adjust = self.getConf(self.ADJUST_BOXES_BOUNDS)
         return self.__convertBoolSetting(adjust)
 
+    def setDeskewImagesAfterAddition(self, deskew_images_after_addition):
+        self.setConf(self.DESKEW_IMAGES_AFTER_ADDITION,
+                     deskew_images_after_addition)
+
+    def getDeskewImagesAfterAddition(self):
+        deskew = self.getConf(self.DESKEW_IMAGES_AFTER_ADDITION)
+        return self.__convertBoolSetting(deskew)
+
     def setBoundsAdjustmentSize(self, adjustment_size):
         self.setConf(self.BOUNDS_ADJUSTMENT_SIZE, adjustment_size)
 
@@ -502,3 +512,6 @@ class ConfigurationManager(object):
 
     bounds_adjustment_size = property(getBoundsAdjustmentSize,
                                       setBoundsAdjustmentSize)
+
+    deskew_images_after_addition = property(getDeskewImagesAfterAddition,
+                                            setDeskewImagesAfterAddition)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]