当前位置: 首页>>代码示例>>Python>>正文


Python Mnemosyne.extra_components_for_plugin["CrammingPlugin"]方法代码示例

本文整理汇总了Python中mnemosyne.libmnemosyne.Mnemosyne.extra_components_for_plugin["CrammingPlugin"]方法的典型用法代码示例。如果您正苦于以下问题:Python Mnemosyne.extra_components_for_plugin["CrammingPlugin"]方法的具体用法?Python Mnemosyne.extra_components_for_plugin["CrammingPlugin"]怎么用?Python Mnemosyne.extra_components_for_plugin["CrammingPlugin"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mnemosyne.libmnemosyne.Mnemosyne的用法示例。


在下文中一共展示了Mnemosyne.extra_components_for_plugin["CrammingPlugin"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: startup

# 需要导入模块: from mnemosyne.libmnemosyne import Mnemosyne [as 别名]
# 或者: from mnemosyne.libmnemosyne.Mnemosyne import extra_components_for_plugin["CrammingPlugin"] [as 别名]

#.........这里部分代码省略.........
    if options.data_dir != None:
        data_dir = os.path.abspath(options.data_dir)
    elif os.path.exists(os.path.join(os.getcwdu(), "mnemosyne2")):
        data_dir = os.path.abspath(os.path.join(os.getcwdu(), "mnemosyne2"))

    # Filename argument.
    if len(args) > 0:
        filename = os.path.abspath(args[0])
    else:
        filename = None

    # Load the Mnemosyne library.
    mnemosyne = Mnemosyne(upload_science_logs=True)

    # Initialise GUI toolkit.
    a = QApplication(sys.argv)
    a.setApplicationName("Mnemosyne")
    # TODO: install translator for Qt messages.
    # Under Windows, move out of library.zip to get the true prefix.
    # from mnemosyne.pyqt_ui.main_window import prefix
    #if sys.platform == "win32":
    #    prefix = os.path.split(prefix)[0]
    #    prefix = os.path.split(prefix)[0]
    #    prefix = os.path.split(prefix)[0]
    #translator = QTranslator(a)
    #translator.load("qt_" + loc + ".qm", os.path.join(prefix, 'locale'))
    #a.installTranslator(translator)

    # Add other components we need. The translator should obviously come first,
    # and the UI components should come in the order they should be instantiated,
    # but apart from that, the order does not matter.
    mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                                 "GetTextTranslator"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.main_wdgt",
                                 "MainWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.review_wdgt",
                                 "ReviewWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.configuration",
                                 "PyQtConfiguration"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.pyqt_render_chain",
                                 "PyQtRenderChain"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.add_cards_dlg",
                                 "AddCardsDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.edit_card_dlg",
                                 "EditCardDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.browse_cards_dlg",
                                 "BrowseCardsDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.activate_cards_dlg",
                                 "ActivateCardsDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.cloned_card_types_list_dlg",
                                 "ClonedCardTypesListDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.card_appearance_dlg",
                                 "CardAppearanceDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.activate_plugins_dlg",
                                 "ActivatePluginsDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_dlg",
                                 "StatisticsDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.card_type_wdgt_generic",
                                 "GenericCardTypeWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgts_plotting",
                                 "ScheduleWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgts_plotting",
                                 "RetentionScoreWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgts_plotting",
                                 "GradesWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgts_plotting",
                                 "EasinessWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgts_plotting",
                                 "CardsAddedWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.statistics_wdgt_html",
                                 "HtmlStatisticsWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.criterion_wdgt_default",
                                 "DefaultCriterionWdgt"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.configuration_dlg",
                                 "ConfigurationDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.sync_dlg",
                                 "SyncDlg"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.qt_sync_server",
                                 "QtSyncServer"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.configuration_wdgt_main",
                                 "ConfigurationWdgtMain"))
    mnemosyne.components.append(("mnemosyne.pyqt_ui.configuration_wdgt_sync_server",
                                 "ConfigurationWdgtSyncServer"))
    mnemosyne.extra_components_for_plugin["CrammingPlugin"] = \
                                [("mnemosyne.pyqt_ui.review_wdgt_cramming",
                                 "ReviewWdgtCramming")]

    # Run Mnemosyne.
    mnemosyne.initialise(data_dir=data_dir, filename=filename)
    mnemosyne.main_widget().show()
    mnemosyne.main_widget().raise_() # Needed for OSX.
    # TODO: check first run wizard.
    #if config()["first_run"] == True:
    #    w.productTour()
    #    config()["first_run"] = False
    #elif config()["show_daily_tips"] == True:
    #    w.Tip()

    a.exec_()
    mnemosyne.finalise()
开发者ID:tbabej,项目名称:mnemosyne,代码行数:104,代码来源:benchmark_pyqt.py


注:本文中的mnemosyne.libmnemosyne.Mnemosyne.extra_components_for_plugin["CrammingPlugin"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。