Beispiel #1
0
 def engineToXml(self, engine, path=None):
     if not path:
         path = os.path.join(self.configuration_manager.user_engines_folder,
                             engine.name + '.xml')
         path = lib.getNonExistingFileName(path)
     engine_content = engine.saveToXml(path)
     return path
Beispiel #2
0
 def __deskewImage(self, image_path, target_image_path = None):
     if not target_image_path:
         tmp_dir = self.configuration_manager.TEMPORARY_FOLDER
         target_image_path = os.path.join(tmp_dir,
                                          os.path.basename(image_path))
         if os.path.exists(target_image_path):
             target_image_path = getNonExistingFileName(target_image_path)
     image_deskewer = ImageDeskewer()
     if image_deskewer.deskew(image_path, target_image_path):
         return target_image_path
     return image_path
Beispiel #3
0
 def __deskewImage(self, image_path, target_image_path=None):
     if not target_image_path:
         tmp_dir = self.configuration_manager.TEMPORARY_FOLDER
         target_image_path = os.path.join(tmp_dir,
                                          os.path.basename(image_path))
         if os.path.exists(target_image_path):
             target_image_path = getNonExistingFileName(target_image_path)
     image_deskewer = ImageDeskewer()
     if image_deskewer.deskew(image_path, target_image_path):
         return target_image_path
     return image_path
Beispiel #4
0
 def engineToXml(self, engine, path = None):
     if not path:
         path = os.path.join(self.configuration_manager.user_engines_folder, engine.name + '.xml')
         path = lib.getNonExistingFileName(path)
     engine_content = engine.saveToXml(path)
     return path