Accept a single directory argument on the command line.

This commit is contained in:
Andrey Golovizin 2014-08-21 21:09:01 +02:00
parent a666a9f85b
commit a929d1011b
2 changed files with 5 additions and 3 deletions

View file

@ -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)

View file

@ -14,6 +14,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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()