Esempio n. 1
0
def main():

    app = QApplicationMessaging(sys.argv)
    if app.isRunning():
        if len(sys.argv) > 1:
            app.sendMessage(sys.argv[1])
        else:
            app.sendMessage('ARISE')
    else:
        main = MainWindow(app)
        app.aboutToQuit.connect(main.cleanUp)

        app.setActiveWindow(main)
        main.show()
        sys.exit(app.exec_())
Esempio n. 2
0
def main():
    freeze_support()

    app = QApplicationMessaging(sys.argv)
    if app.isRunning():
        if len(sys.argv) > 1:
            app.sendMessage(sys.argv[1])
        else:
            app.sendMessage('ARISE')
    else:
        main = MainWindow(app)
        app.aboutToQuit.connect(main.cleanUp)

        app.setActiveWindow(main)
        main.show()
        sys.exit(app.exec_())
Esempio n. 3
0
def main():

    app = QApplicationMessaging(sys.argv)
    if app.isRunning():
        if len(sys.argv) > 1:
            app.sendMessage(sys.argv[1])
        else:
            app.sendMessage('ARISE')
    else:
        main = MainWindow(app)
        main.setWindowIcon(QIcon(':/favicon.png'))
        app.aboutToQuit.connect(main.cleanUp)

        app.setActiveWindow(main)
        main.show()
        sys.exit(app.exec_())
Esempio n. 4
0
import os
import sys

base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, base)
from corpustools.gui.main import MainWindow, QApplicationMessaging

if __name__ == "__main__":

    app = QApplicationMessaging(sys.argv)
    if app.isRunning():
        if len(sys.argv) > 1:
            app.sendMessage(sys.argv[1])
        else:
            app.sendMessage("ARISE")
    else:
        main = MainWindow(app)

        app.aboutToQuit.connect(main.cleanUp)
        app.setActiveWindow(main)
        main.show()
        sys.exit(app.exec_())
Esempio n. 5
0
import os
import sys
base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, base)
from corpustools.gui.main import MainWindow, QApplicationMessaging

if __name__ == '__main__':

    app = QApplicationMessaging(sys.argv)
    if app.isRunning():
        if len(sys.argv) > 1:
            app.sendMessage(sys.argv[1])
        else:
            app.sendMessage('ARISE')
    else:
        main = MainWindow(app)

        app.aboutToQuit.connect(main.cleanUp)
        app.setActiveWindow(main)
        main.show()
        sys.exit(app.exec_())
Esempio n. 6
0
import sys
import unittest
from PyQt5.QtTest import QTest
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QGuiApplication
from corpustools.gui.flgui import FLDialog, FLWorker
from corpustools.corpus.io import load_binary
from corpustools.gui.models import InventoryModel
from corpustools.gui.main import MainWindow, QApplicationMessaging

app = QApplicationMessaging(sys.argv)
main = MainWindow(app)


class FLTester(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        corpus = load_binary(
            r'C:\Users\Scott\Documents\GitHub\CorpusTools\corpustools\lemurian.corpus'
        )
        inventory = InventoryModel(corpus.inventory, copy_mode=True)
        cls.dialog = FLDialog(main, None, corpus, inventory, False)

    def test_FuncLoadAlgorithmChoice(self):
        print(self.dialog.algorithmWidget.value())
        self.dialog.algorithmWidget.widgets[1].click()
        #why doesn't this work with QTest.mouseClick(...,Qt.LeftButton, Qt.NoModifier) ???
        print(self.dialog.algorithmWidget.value())
        self.assertEqual(self.dialog.algorithmWidget.value(), 'entropy')

    def test_MinFreqEdit(self):