diff --git a/pixelocr/gui/__init__.py b/pixelocr/gui/__init__.py index 343b5ef..8855975 100644 --- a/pixelocr/gui/__init__.py +++ b/pixelocr/gui/__init__.py @@ -42,7 +42,7 @@ def main(): win = MainWindow() win.show() - ocr = OCREngine(sys.argv[1:]) + ocr = OCREngine(sys.argv[1]) ocr.pageChanged.connect(win.pageScene.setPage) ocr.unknownGlyph.connect(win.unknownGlyph) win.glyphEntered.connect(ocr.give_help) diff --git a/pixelocr/gui/ocrengine.py b/pixelocr/gui/ocrengine.py index 0d31da0..409d045 100644 --- a/pixelocr/gui/ocrengine.py +++ b/pixelocr/gui/ocrengine.py @@ -14,6 +14,8 @@ # along with this program. If not, see . +from glob import glob +from os import path from queue import Queue from PyQt4.QtCore import ( @@ -30,9 +32,9 @@ class OCREngine(QThread): unknownGlyph = signal([Glyph]) pageChanged = signal([Page]) - def __init__(self, filenames): + def __init__(self, dirname): super().__init__() - self.filenames = filenames + self.filenames = glob(path.join(dirname, '*.png')) self.chardb = {} self.help_queue = Queue()