Accept a single directory argument on the command line.
This commit is contained in:
parent
a666a9f85b
commit
a929d1011b
2 changed files with 5 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ def main():
|
||||||
win = MainWindow()
|
win = MainWindow()
|
||||||
win.show()
|
win.show()
|
||||||
|
|
||||||
ocr = OCREngine(sys.argv[1:])
|
ocr = OCREngine(sys.argv[1])
|
||||||
ocr.pageChanged.connect(win.pageScene.setPage)
|
ocr.pageChanged.connect(win.pageScene.setPage)
|
||||||
ocr.unknownGlyph.connect(win.unknownGlyph)
|
ocr.unknownGlyph.connect(win.unknownGlyph)
|
||||||
win.glyphEntered.connect(ocr.give_help)
|
win.glyphEntered.connect(ocr.give_help)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# 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 queue import Queue
|
||||||
|
|
||||||
from PyQt4.QtCore import (
|
from PyQt4.QtCore import (
|
||||||
|
|
@ -30,9 +32,9 @@ class OCREngine(QThread):
|
||||||
unknownGlyph = signal([Glyph])
|
unknownGlyph = signal([Glyph])
|
||||||
pageChanged = signal([Page])
|
pageChanged = signal([Page])
|
||||||
|
|
||||||
def __init__(self, filenames):
|
def __init__(self, dirname):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.filenames = filenames
|
self.filenames = glob(path.join(dirname, '*.png'))
|
||||||
self.chardb = {}
|
self.chardb = {}
|
||||||
self.help_queue = Queue()
|
self.help_queue = Queue()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue