コード例 #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
ファイル: ppqt.py プロジェクト: tallforasmurf/PPQT
        # 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
ファイル: pqChars.py プロジェクト: tallforasmurf/PPQT

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