예제 #1
0
파일: suzu.py 프로젝트: Xifax/suzu
def main():
    
    app = QApplication(sys.argv)
    app.setWindowIcon(QIcon(PATH_TO_RES + LOGOS + 'suzu.png'))
    
    # application settings #
    options = Options()
    if options.isPlastique():  app.setStyle('plastique')
    
    # main gui module #
    quiz = Quiz(options)
    
    # additional gui components #
    about = About()
    options = OptionsDialog(quiz.srs.db, quiz.options)
    qdict = QuickDictionary(quiz.jmdict, quiz.edict, quiz.kjd, quiz.srs.db, quiz.options)
    
    # background updater #
    updater = BackgroundDownloader(quiz.options.getRepetitionInterval())
    updater.start()
    
    # additional tools #
    tools = Tools()
    web = WebPage()
    statistics = StatsInfo(quiz.srs.db)
    rehash = QuizRehash(quiz.srs.db, quiz.kjd, quiz.edict)
    
    # initializing references and hotkeys #
    quiz.addReferences(about, options, qdict, updater, tools, statistics, web, rehash)
    quiz.initGlobalHotkeys()
    
    try:
        sys.exit(app.exec_())
    except Exception, e:
        log.debug(e)
예제 #2
0
파일: suzu_ei.py 프로젝트: Xifax/suzu_ei
    
    #from srs.srsManager import srsScheduler
    
#    srs = srsScheduler()
#    srs.initializeAll()
#    srs.db.addItemsToDb(18000, 29000)
#    srs.initializeCurrentSession(100)
#    srs.getNextItem()
#    item = srs.getCurrentItem()
#    example = srs.getCurrentExample()
#    translation = srs.getCurrentSentenceTranslation()
#    pass

    app = QApplication(sys.argv)
    
    quiz = Quiz()
    if quiz.options.isPlastique():  app.setStyle('plastique')
    quiz.setWindowIcon(QIcon('../res/icons/suzu.png'))
    
    about = About()
    options = OptionsDialog(quiz.srs.db, quiz.srs.db.frequency, quiz.options)
    #qdict = QuickDictionary(quiz.jmdict, quiz.edict, quiz.kjd, quiz.srs.db, quiz.options)
        
    #updater = BackgroundDownloader(quiz.options.getRepetitionInterval())
    #updater.start()
    qdict = (); updater = ()
    
    quiz.addReferences(about, options, qdict, updater)
#    quiz.initGlobalHotkeys() 
    
    try:
예제 #3
0
    #from srs.srsManager import srsScheduler

    #    srs = srsScheduler()
    #    srs.initializeAll()
    #    srs.db.addItemsToDb(18000, 29000)
    #    srs.initializeCurrentSession(100)
    #    srs.getNextItem()
    #    item = srs.getCurrentItem()
    #    example = srs.getCurrentExample()
    #    translation = srs.getCurrentSentenceTranslation()
    #    pass

    app = QApplication(sys.argv)

    quiz = Quiz()
    if quiz.options.isPlastique(): app.setStyle('plastique')
    quiz.setWindowIcon(QIcon('../res/icons/suzu.png'))

    about = About()
    options = OptionsDialog(quiz.srs.db, quiz.srs.db.frequency, quiz.options)
    #qdict = QuickDictionary(quiz.jmdict, quiz.edict, quiz.kjd, quiz.srs.db, quiz.options)

    #updater = BackgroundDownloader(quiz.options.getRepetitionInterval())
    #updater.start()
    qdict = ()
    updater = ()

    quiz.addReferences(about, options, qdict, updater)
    #    quiz.initGlobalHotkeys()