示例#1
0
文件: pqChars.py 项目: jlg234bob/PPQT
    def sigResetOver(self):
        pqMsgs.clearStatusMsg()


if __name__ == "__main__":
    import sys
    from PyQt4.QtCore import (Qt, QFile, QIODevice, QTextStream)
    from PyQt4.QtGui import (QApplication, QFileDialog, QMainWindow)
    import pqIMC
    IMC = pqIMC.tricorder()  # create inter-module communicator
    app = QApplication(sys.argv)  # create an app
    import pqMsgs
    pqMsgs.IMC = IMC
    import pqLists
    IMC.charCensus = pqLists.vocabList()
    CP = charsPanel()  # create the widget with the table view and model
    MW = QMainWindow()
    MW.setCentralWidget(CP)
    IMC.statusBar = MW.statusBar()
    MW.show()
    utname = QFileDialog.getOpenFileName(MW, "UNIT TEST DATA FOR CHARS", ".")
    utfile = QFile(utname)
    if not utfile.open(QIODevice.ReadOnly):
        raise IOError, unicode(utfile.errorString())

    CP.docWillChange()

    utstream = QTextStream(utfile)
    utstream.setCodec("UTF-8")
    utqs = utstream.readAll()
示例#2
0
        # OK, no fonts bundled with us (or they've been removed?)
        IMC.defaultFontFamily = QString(u'Courier New')
IMC.fontFamily = IMC.defaultFontFamily # pqMain may override
# Make the application default be that which we just set
# app.setFont(pqMsgs.getMonoFont()) -- do NOT as it is a bad
# idea to have monospaced menus, titles, etc!

# Import each submodule and stick a reference to IMC into it.

import pqLists # implements ordered lists of words for quick lookup
pqLists.IMC = IMC
# instantiate all our lists empty
IMC.scannoList = pqLists.wordList()
IMC.goodWordList = pqLists.wordList()
IMC.badWordList = pqLists.wordList()
IMC.wordCensus = pqLists.vocabList()
IMC.charCensus = pqLists.vocabList()

import pqPages # page and folio table
pqPages.IMC = IMC
IMC.pageTable = pqPages.pagedb()

import pqEdit # the main edit widget plus save and load metadata
pqEdit.IMC = IMC

import pqPngs # scan image display
pqPngs.IMC = IMC

import pqNotes # notes
pqNotes.IMC = IMC
示例#3
0
文件: ppqt.py 项目: jlg234bob/PPQT
        IMC.defaultFontFamily = QString(u'Courier New')
IMC.fontFamily = IMC.defaultFontFamily  # pqMain may override
# Make the application default be that which we just set
# app.setFont(pqMsgs.getMonoFont()) -- do NOT as it is a bad
# idea to have monospaced menus, titles, etc!

# Import each submodule and stick a reference to IMC into it.

import pqLists  # implements ordered lists of words for quick lookup

pqLists.IMC = IMC
# instantiate all our lists empty
IMC.scannoList = pqLists.wordList()
IMC.goodWordList = pqLists.wordList()
IMC.badWordList = pqLists.wordList()
IMC.wordCensus = pqLists.vocabList()
IMC.charCensus = pqLists.vocabList()

import pqPages  # page and folio table

pqPages.IMC = IMC
IMC.pageTable = pqPages.pagedb()

import pqEdit  # the main edit widget plus save and load metadata

pqEdit.IMC = IMC

import pqPngs  # scan image display

pqPngs.IMC = IMC
示例#4
0

if __name__ == "__main__":
    import sys
    from PyQt4.QtCore import Qt, QFile, QIODevice, QTextStream
    from PyQt4.QtGui import QApplication, QFileDialog, QMainWindow
    import pqIMC

    IMC = pqIMC.tricorder()  # create inter-module communicator
    app = QApplication(sys.argv)  # create an app
    import pqMsgs

    pqMsgs.IMC = IMC
    import pqLists

    IMC.charCensus = pqLists.vocabList()
    CP = charsPanel()  # create the widget with the table view and model
    MW = QMainWindow()
    MW.setCentralWidget(CP)
    IMC.statusBar = MW.statusBar()
    MW.show()
    utname = QFileDialog.getOpenFileName(MW, "UNIT TEST DATA FOR CHARS", ".")
    utfile = QFile(utname)
    if not utfile.open(QIODevice.ReadOnly):
        raise IOError, unicode(utfile.errorString())

    CP.docWillChange()

    utstream = QTextStream(utfile)
    utstream.setCodec("UTF-8")
    utqs = utstream.readAll()