[ocrfeeder] Do not use multiple args in debug call



commit be53f66b20acd85e267a4246b76afe7e0c652291
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Sat Mar 19 17:14:57 2016 +0100

    Do not use multiple args in debug call
    
    When calling debug, it should not give its parameters as a tupple of
    arguments. Instead, it should provide one debug message.

 src/ocrfeeder/feeder/documentGeneration.py |    2 +-
 src/ocrfeeder/feeder/imageManipulation.py  |    2 +-
 src/ocrfeeder/feeder/ocrEngines.py         |    2 +-
 src/ocrfeeder/studio/project.py            |    2 +-
 src/ocrfeeder/studio/widgetModeler.py      |    4 ++--
 src/ocrfeeder/studio/widgetPresenter.py    |    2 +-
 src/ocrfeeder/util/graphics.py             |    2 +-
 src/ocrfeeder/util/lib.py                  |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/ocrfeeder/feeder/documentGeneration.py b/src/ocrfeeder/feeder/documentGeneration.py
index 418ecde..8f4b817 100644
--- a/src/ocrfeeder/feeder/documentGeneration.py
+++ b/src/ocrfeeder/feeder/documentGeneration.py
@@ -250,7 +250,7 @@ class OdtGenerator(DocumentGenerator):
     def addText(self, data_box):
         text = data_box.getText().decode('utf-8')
         frame_style = Style(name='FrameStyle', family = 'graphic')
-        debug('Angle: ', data_box.text_data.angle)
+        debug('Angle: %s' % data_box.text_data.angle)
         angle = data_box.text_data.angle
         if angle:
             frame_style = Style(name='FrameStyleRotated', family = 'graphic')
diff --git a/src/ocrfeeder/feeder/imageManipulation.py b/src/ocrfeeder/feeder/imageManipulation.py
index ad94cf1..63957f6 100644
--- a/src/ocrfeeder/feeder/imageManipulation.py
+++ b/src/ocrfeeder/feeder/imageManipulation.py
@@ -42,7 +42,7 @@ class ImageProcessor:
                 self.black_n_white_image = self.original_image.convert('L')
                 if not self.window_size:
                     self.window_size = self.original_image.size[1] / 60.
-                debug('Window Size: ', self.window_size)
+                debug('Window Size: %s' % self.window_size)
             except:
                 debug(sys.exc_info())
                 raise ImageManipulationError(error_message)
diff --git a/src/ocrfeeder/feeder/ocrEngines.py b/src/ocrfeeder/feeder/ocrEngines.py
index b8636d0..cf662d1 100644
--- a/src/ocrfeeder/feeder/ocrEngines.py
+++ b/src/ocrfeeder/feeder/ocrEngines.py
@@ -250,7 +250,7 @@ class OcrEnginesManager:
         try:
             engine = Engine(**arguments)
         except TypeError, exception:
-            lib.debug('Error when unserializing engine: %s', exception.message)
+            lib.debug('Error when unserializing engine: %s' % exception.message)
             engine = None
         except WrongSettingsForEngine, we:
             lib.debug("Cannot load engine at %s: %s" %( xml_file_name, str(we)))
diff --git a/src/ocrfeeder/studio/project.py b/src/ocrfeeder/studio/project.py
index 188b0f5..b02fc17 100644
--- a/src/ocrfeeder/studio/project.py
+++ b/src/ocrfeeder/studio/project.py
@@ -132,7 +132,7 @@ class ProjectLoader:
         page_data_nodes = document.getElementsByTagName('PageData')
         pages = []
         for page_data in self.__getPageDataInfo(page_data_nodes):
-            debug('Page Data:', page_data)
+            debug('Page Data: %s' % page_data)
             data_boxes = []
             for data_box in page_data['data_boxes']:
                 args = []
diff --git a/src/ocrfeeder/studio/widgetModeler.py b/src/ocrfeeder/studio/widgetModeler.py
index 942e5d1..9a002f7 100644
--- a/src/ocrfeeder/studio/widgetModeler.py
+++ b/src/ocrfeeder/studio/widgetModeler.py
@@ -727,7 +727,7 @@ class ImageReviewer_Controler:
                     page.setSize(size)
             else:
                 current_reviewer.page.setSize(size)
-            debug('Page size: ', size)
+            debug('Page size: %s' % size)
         page_size_dialog.destroy()
         self.__updateStatusBar(current_reviewer)
 
@@ -997,7 +997,7 @@ class Editor:
     def __pressedAngleDetectionButton(self, widget):
         image = graphics.convertPixbufToImage(self.box_editor.getImage())
         angle = graphics.getHorizontalAngleForText(image)
-        debug('ANGLE: ', angle)
+        debug('ANGLE: %s' % angle)
         self.box_editor.setAngle(angle)
 
     def saveDataBox(self):
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index c496cfa..139f2d0 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -1359,7 +1359,7 @@ class PreferencesDialog(Gtk.Dialog):
                 self.unpaper_images.get_active()
         index = self.engines_combo.get_active()
         if index != -1:
-            lib.debug('ACTIVE INDEX: ', index, self.ocr_engines[index][0].name)
+            lib.debug('ACTIVE INDEX: %s %s' % (index, self.ocr_engines[index][0].name))
             self.configuration_manager.setFavoriteEngine(self.ocr_engines[index][0].name)
 
     def __makeGeneralPreferences(self, *args):
diff --git a/src/ocrfeeder/util/graphics.py b/src/ocrfeeder/util/graphics.py
index 4f6f3e9..270e6a3 100644
--- a/src/ocrfeeder/util/graphics.py
+++ b/src/ocrfeeder/util/graphics.py
@@ -136,7 +136,7 @@ def getTextSizeFromImage(image):
                 text_size = math.floor(i)
                 break
         text_size = max(text_sizes)
-    debug('Text Size: ', text_size)
+    debug('Text Size: %s' % text_size)
     return text_size
 
 def getTextBeginHeight(image):
diff --git a/src/ocrfeeder/util/lib.py b/src/ocrfeeder/util/lib.py
index e972c3b..7d3bbf6 100644
--- a/src/ocrfeeder/util/lib.py
+++ b/src/ocrfeeder/util/lib.py
@@ -45,7 +45,7 @@ def getIconOrLabel(icon_name, label_text, icon_size = Gtk.IconSize.SMALL_TOOLBAR
 
 def convertPdfToImages(pdf_file, temp_dir = '/tmp'):
     dir_name = tempfile.mkdtemp(dir = temp_dir)
-    debug('Converting PDF: ', pdf_file, ' to image')
+    debug('Converting PDF: %s to image' % pdf_file)
     resolution = 300
     file_name = os.path.splitext(os.path.basename(pdf_file))[0]
     command = 'gs -SDEVICE=jpeg -r%(resolution)sx%(resolution)s -sPAPERSIZE=letter ' \


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