Exemplo n.º 1
0
def main(argv):
    app = QApplication(argv)

    splash = None
    pixmap = QPixmap(':/img/splashscreen.png')
    splash = QSplashScreen(pixmap)
    splash.show()

    qtTr = QTranslator()
    if qtTr.load("qt_" + QLocale.system().name(), ':/i18n'):
        app.installTranslator(qtTr)

    appTr = QTranslator()
    if appTr.load("qsurveytools_" + QLocale.system().name(), ':/i18n'):
        app.installTranslator(appTr)

    from src.mainwindow import MainWindow

    win = MainWindow()
    win.show()

    if splash is not None:
        splash.finish(win)

    return app.exec_()
Exemplo n.º 2
0
def main():

    app = QApplication(sys.argv)
    config.fileConfig(ConfigFile.LOGGING)

    # Initialize views
    window = MainWindow(UiFile.MAIN_WINDOW)
    user_dialog = UserDialog(UiFile.USER_DIALOG)
    query_dialog = QueryDialog(UiFile.QUERY_DIALOG)

    # Initialize model dependencies
    scheduler = TaskScheduler(QtScheduler(logger=getLogger('scheduler')))
    emailer = EmailSender(EmailClient(HOST, PORT, EMAIL, PASSWORD))
    reddit = Reddit(
        praw.Reddit(client_id=ID, client_secret=None, user_agent=AGENT))
    user_validator = UserValidator()
    user_retriever = PickleStorageRetriever(StorageFile.USER)
    user_saver = PickleStorageSaver(StorageFile.USER)
    user_storage = FileStorage(user_retriever, user_saver)
    query_retriever = PickleStorageRetriever(StorageFile.QUERYLISTING)
    query_saver = PickleStorageSaver(StorageFile.QUERYLISTING)
    query_storage = FileStorage(query_retriever, query_saver)

    # Initialize model
    window_model = MainWindowModel(scheduler, user_storage, query_storage,
                                   emailer, reddit)
    user_dialog_model = UserDialogModel(scheduler, user_storage,
                                        user_validator)
    query_dialog_model = QueryDialogModel(scheduler, query_storage, reddit)

    # Initialize presenters
    window_presenter = MainWindowPresenter(window, window_model)
    user_dialog_presenter = UserDialogPresenter(user_dialog, user_dialog_model)
    query_dialog_presenter = QueryDialogPresenter(query_dialog,
                                                  query_dialog_model)

    # Connect signals to slots
    window.user_dialog_clicked.connect(user_dialog.show)
    window.query_dialog_clicked.connect(query_dialog.show)
    user_dialog.confirm_clicked.connect(
        user_dialog_presenter.validate_user_info)
    query_dialog.confirm_clicked.connect(
        query_dialog_presenter.validate_subreddit)
    scheduler.user_ready.connect(window_presenter.when_user_ready)
    scheduler.query_ready.connect(window_presenter.when_query_ready)
    scheduler.querylisting_available.connect(
        window_presenter.with_querylisting)
    scheduler.query_available.connect(window_presenter.with_query)
    scheduler.query_result_available.connect(
        window_presenter.with_query_result)

    window.show()
    sys.exit(app.exec_())
Exemplo n.º 3
0
def main(argv):
    app = QtWidgets.QApplication(argv)

    qtTr = QtCore.QTranslator()
    if qtTr.load("qt_" + QtCore.QLocale.system().name(), ":/i18n/"):
        app.installTranslator(qtTr)

    xlpickerTr = QtCore.QTranslator()
    if xlpickerTr.load("xlpicker_" + QtCore.QLocale.system().name(),
                       ":/i18n/"):
        app.installTranslator(xlpickerTr)

    win = MainWindow()
    win.show()

    return app.exec_()
Exemplo n.º 4
0
logger = logging.getLogger('curve-editor')
logger.setLevel(logging.DEBUG)

# Logger section
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

fh = logging.FileHandler('curve-editor.log')
fh.setLevel(logging.DEBUG)

formatter = logging.Formatter(
    "[%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(funcName)s()] %(message)s"
)
ch.setFormatter(formatter)
fh.setFormatter(formatter)

logger.addHandler(ch)
logger.addHandler(fh)

import sys
from PyQt5 import QtWidgets

from src.mainwindow import MainWindow

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    app.exec_()
Exemplo n.º 5
0
# Copyright (C) 2016 pfechd
#
# This file is part of JABE.
#
# JABE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# JABE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with JABE.  If not, see <http://www.gnu.org/licenses/>.

import sys
from src.mainwindow import MainWindow
from PyQt5 import QtWidgets

app = QtWidgets.QApplication(sys.argv)
x = MainWindow()
sys.exit(app.exec_())
Exemplo n.º 6
0
#!/usr/bin/env python

import sys

from PyQt5.QtWidgets import QApplication

from src.mainwindow import MainWindow

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow(None)
    window.login()
    sys.exit(app.exec_())

Exemplo n.º 7
0
from PyQt5.QtWidgets import QApplication
from src.mainwindow import MainWindow
import sys

if __name__ == '__main__':
    app = QApplication(sys.argv)
    main = MainWindow()
    main.show()
    sys.exit(app.exec_())
Exemplo n.º 8
0
import wx
from src.mainwindow import MainWindow

if __name__ == '__main__':
    app = wx.App()
    frm = MainWindow()
    frm.Show()
    app.MainLoop()
Exemplo n.º 9
0
from PySide2.QtWidgets import QApplication
from src.mainwindow import MainWindow
import sys

if __name__ == '__main__':

    app = QApplication(sys.argv)
    mainWindow = MainWindow()
    mainWindow.show()
    sys.exit(app.exec_())
Exemplo n.º 10
0
def main():
    app = QtWidgets.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    app.exec()