• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python libmnemosyne.Mnemosyne类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mnemosyne.libmnemosyne.Mnemosyne的典型用法代码示例。如果您正苦于以下问题:Python Mnemosyne类的具体用法?Python Mnemosyne怎么用?Python Mnemosyne使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

    def __init__(self, datadir=None, category=None):
        
        Mnemosyne.__init__(self)

        self.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                                  "GetTextTranslator"))
        self.components.append(\
                    ("mnemosyne.libmnemosyne.ui_components.review_widget",
                     "ReviewWidget"))
        self.components.append(\
                    ("mnemosyne.libmnemosyne.ui_components.main_widget",
                     "MainWidget"))

        self.components.append(("mnemosyne.maemo_ui.factory", "ConfigHook"))
        
        if datadir:
            datadir = os.path.abspath(datadir)
        elif os.path.exists(os.path.join(os.getcwdu(), ".mnemosyne")):
            datadir = os.path.abspath(os.path.join(os.getcwdu(), ".mnemosyne"))
        else:
            datadir = os.path.abspath(os.path.join(os.path.expanduser("~"), 
                        ".mnemosyne"))


        self.initialise(datadir)
        self.review_controller().reset()

        self.card_type = [ct for ct in self.card_types() \
                            if ct.name == "Front-to-back only"][0]
        self.saved = False
        
        self.category = category #Category(category)
开发者ID:bartosh,项目名称:pomni,代码行数:32,代码来源:csvconv.py


示例2: TestSmconvImport

class TestSmconvImport(MnemosyneTest):
    def setup(self):
        self.initialise_data_dir()
        self.mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True, asynchronous_database=True)
        self.mnemosyne.components.insert(
            0, ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator")
        )
        self.mnemosyne.components.append(("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.components.append(("test_smconv_import", "Widget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.review_controller().reset()

    def sm7_importer(self):
        for format in self.mnemosyne.component_manager.all("file_format"):
            if format.__class__.__name__ == "Smconv_XML":
                return format

    def test_1(self):
        global last_error
        filename = os.path.join(os.getcwd(), "tests", "files", "smconv.xml")
        self.sm7_importer().do_import(filename)
        assert last_error is ""
        assert len([c for c in self.database().cards()]) == 3

    def teardown(self):
        filename = os.path.join(os.getcwd(), "dot_test", "default.db_media", "a.png")
        if os.path.exists(filename):
            os.remove(filename)
        filename = os.path.join(os.getcwd(), "dot_test", "test.txt")
        if os.path.exists(filename):
            os.remove(filename)
        MnemosyneTest.teardown(self)
开发者ID:tbabej,项目名称:mnemosyne,代码行数:32,代码来源:test_smconv_import.py


示例3: MnemosyneTest

class MnemosyneTest():
    
    def setup(self):
        os.system("rm -fr dot_test")
        self.restart()

    def restart(self):
        self.mnemosyne = Mnemosyne()
        self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                             "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.main_widget", "MainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ProgressDialog"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"))
        self.review_controller().reset()

    def teardown(self):
        self.mnemosyne.finalise()

    def config(self):
        return self.mnemosyne.component_manager.get_current("config")

    def log(self):
        return self.mnemosyne.component_manager.get_current("log")

    def database(self):
        return self.mnemosyne.component_manager.get_current("database")

    def scheduler(self):
        return self.mnemosyne.component_manager.get_current("scheduler")

    def main_widget(self):
        return self.mnemosyne.component_manager.get_current("main_widget")

    def review_widget(self):
        return self.mnemosyne.component_manager.get_current("review_widget")

    def controller(self):
        return self.mnemosyne.component_manager.get_current("controller")

    def review_controller(self):
        return self.mnemosyne.component_manager.get_current("review_controller")

    def card_types(self):
        return self.mnemosyne.component_manager.get_all("card_type")

    def filters(self):
        return self.mnemosyne.component_manager.get_all("filter")

    def plugins(self):
        return self.mnemosyne.component_manager.get_all("plugin")

    def card_type_by_id(self, id): 
        return self.mnemosyne.component_manager.card_type_by_id[id]
开发者ID:bartosh,项目名称:pomni,代码行数:57,代码来源:mnemosyne_test.py


示例4: TestMainController

class TestMainController(MnemosyneTest):

    def setup(self):
        os.system("rm -fr dot_test")
        
        self.mnemosyne = Mnemosyne()
        self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                             "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_main_controller", "Widget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "AddCardsDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "EditFactDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "BrowseCardsDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "CardAppearanceDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ActivatePluginsDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ManageCardTypesDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "StatisticsDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ConfigurationDialog"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ActivateCardsDialog"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"))
        self.review_controller().reset()
        
    def test_coverage(self):
        self.controller().heartbeat()
        self.controller().add_cards()
        card_type = self.card_type_by_id("2")
        fact_data = {"q": "q", "a": "a"}
        card_1, card_2 = self.controller().create_new_cards(fact_data,
          card_type, grade=-1, tag_names=["default"])
        self.review_controller().new_question()        
        self.controller().edit_current_card()        
        self.controller().file_new()
        self.controller().file_open()
        self.controller().file_save_as()
        self.controller().card_appearance()        
        self.controller().activate_plugins()  
        self.controller().manage_card_types()        
        self.controller().browse_cards()
        self.controller().configure()
        self.controller().show_statistics()
        self.controller().activate_cards()
        
    def test_2(self):
        self.controller().file_save_as()
        self.controller().file_open()
开发者ID:bartosh,项目名称:pomni,代码行数:56,代码来源:test_main_controller.py


示例5: __init__

 def __init__(self, data_dir=None):
     MnemosyneParent.__init__(self, upload_science_logs=False,
         interested_in_old_reps=True)
     self.components.insert(0,
         ("mnemosyne.libmnemosyne.translators.gettext_translator",
          "GetTextTranslator"))
     self.components.append(\
         ("mnemosyne.script", "ScriptMainWidget"))
     self.components.append(\
         ("mnemosyne.script", "ScriptReviewWidget"))
     self.initialise(data_dir)
开发者ID:tbabej,项目名称:mnemosyne,代码行数:11,代码来源:__init__.py


示例6: MyClient

class MyClient(Client):
    
    program_name = "Mnemosyne"
    program_version = "test"
    capabilities = "TODO"
    
    def __init__(self):
        os.system("rm -fr dot_benchmark")
        self.mnemosyne = Mnemosyne()
        self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                             "GetTextTranslator"))
        self.mnemosyne.components.append(("test_sync", "Widget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne.libmnemosyne.ui_components.dialogs", "ProgressDialog"))
        self.mnemosyne.initialise(os.path.abspath(os.path.join(os.getcwdu(),
                                  "dot_benchmark")))
        self.mnemosyne.review_controller().reset()        
        Client.__init__(self, "client_machine_id", self.mnemosyne.database(),
                        self.mnemosyne.main_widget())
        
    def do_sync(self):
        self.sync("127.0.0.1", 8190, "user", "pass")
        self.mnemosyne.database().save()
开发者ID:bartosh,项目名称:pomni,代码行数:25,代码来源:benchmark_sync.py


示例7: test_setup

def test_setup():
    shutil.rmtree("dot_test", ignore_errors=True)
    global mnemosyne
    mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True)
    mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translators.gettext_translator",
        "GetTextTranslator"))
    mnemosyne.components.append(\
        ("test_add_cards", "Widget"))
    mnemosyne.components.append(\
        ("mnemosyne_test", "TestReviewWidget"))
    mnemosyne.components.append(\
        ("mnemosyne.libmnemosyne.ui_components.dialogs", "EditCardDialog"))
    mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
    mnemosyne.review_controller().reset()
开发者ID:tbabej,项目名称:mnemosyne,代码行数:14,代码来源:benchmark.py


示例8: TestDBImport

class TestDBImport(MnemosyneTest):

    def setup(self):
        self.initialise_data_dir()
        self.mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True,
                    asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.components.append(\
            ("test_db_import", "Widget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.review_controller().reset()

    def db_importer(self):
        for format in self.mnemosyne.component_manager.all("file_format"):
            if format.__class__.__name__ == "Mnemosyne2Db":
                return format

    def test_1(self):        
        filename = os.path.join(os.getcwd(), "tests", "files", "basedir_to_merge", "config.db")
        self.db_importer().do_import(filename)
        assert "configuration database" in last_error
        
    def test_2(self):
        fact_data = {"f": "question",
                     "b": "answer"}
        card_type = self.card_type_with_id("1")
        old_card = self.controller().create_new_cards(fact_data, card_type,
                                 grade=-1, tag_names=["default"])[0]
        assert len([self.database().cards()]) == 1
        
        filename = os.path.join(os.getcwd(), "tests", "files", "basedir_to_merge", "to_merge.db")
        
        global last_error
        last_error = ""
        self.db_importer().do_import(filename)
        assert last_error == ""
        db = self.database()
        assert db.con.execute("select count() from log where event_type != 26").fetchone()[0] == 258
        self.review_controller().reset()
        assert self.database().card_count() == 7
        assert self.database().active_count() == 6
        assert self.database().fact_count() == 5
        card_type = self.database().card_type("2::new clone", is_id_internal=False)
        assert self.config().card_type_property("background_colour", card_type) == 4278233600


        
开发者ID:tbabej,项目名称:mnemosyne,代码行数:47,代码来源:test_db_import.py


示例9: test_upgrade

 def test_upgrade(self):
     os.system("rm -fr dot_test")
     basedir = os.path.join(os.getcwd(), "tests", "files", "basedir_bz2")
     shutil.copytree(basedir, "dot_test")
     self.mnemosyne = Mnemosyne()
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ProgressDialog"))        
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("test_mem_import", "Widget"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"))
     assert self.config()["grade_0_cards_in_hand"] == 7
     assert "grade_0_items_at_once" not in self.config()
     assert self.config()["dvipng"].rstrip() == \
            "dvipng -D 300 -T tight tmp.dvi\necho"
     assert "14pt" in self.config()["latex_preamble"]
     assert os.path.exists(os.path.join("dot_test", "latex",
                                        "dvipng.NO_LONGER_USED"))
     assert not os.path.exists(os.path.join("dot_test", "latex", "dvipng"))
     self.review_controller().reset()       
开发者ID:vasvlad,项目名称:pomni,代码行数:25,代码来源:test_mem_import.py


示例10: load_mnemosyne

 def load_mnemosyne(self):
     self.mnemosyne = Mnemosyne(upload_science_logs=True,
         interested_in_old_reps=True)
     self.mnemosyne.components.insert(0, (
         ("mnemosyne.libmnemosyne.translators.gettext_translator",
          "GetTextTranslator")))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.main_widget",
          "MainWidget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.web_server.review_wdgt",
          "ReviewWdgt"))
     self.mnemosyne.components.append(\
         ("mnemosyne.web_server.web_server_render_chain",
          "WebServerRenderChain"))
     self.mnemosyne.initialise(self.data_dir, config_dir=self.config_dir,
         filename=self.filename, automatic_upgrades=False)
     self.mnemosyne.review_controller().set_render_chain("web_server")
     self.save_after_n_reps = self.mnemosyne.config()["save_after_n_reps"]
     self.mnemosyne.config()["save_after_n_reps"] = 1
     self.mnemosyne.start_review()
     self.mnemosyne.review_widget().set_is_server_local(\
         self.is_server_local)
     self.is_mnemosyne_loaded = True
     self.release_database_after_timeout = \
         ReleaseDatabaseAfterTimeout(self.port)
     self.release_database_after_timeout.start()
开发者ID:tbabej,项目名称:mnemosyne,代码行数:27,代码来源:web_server.py


示例11: setup

 def setup(self):
     os.system("rm -fr dot_test")
     
     self.mnemosyne = Mnemosyne()
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("test_main_controller", "Widget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "AddCardsDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "EditFactDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "BrowseCardsDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "CardAppearanceDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ActivatePluginsDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ManageCardTypesDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "StatisticsDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ConfigurationDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ActivateCardsDialog"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"))
     self.review_controller().reset()
开发者ID:bartosh,项目名称:pomni,代码行数:30,代码来源:test_main_controller.py


示例12: restart

 def restart(self):
     self.mnemosyne = Mnemosyne()
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("test_logging", "MyMainWidget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"))
     self.review_controller().reset()
开发者ID:bartosh,项目名称:pomni,代码行数:10,代码来源:test_logging.py


示例13: test_log_upload

    def test_log_upload(self):
        machine_id_file = os.path.join(self.mnemosyne.config().config_dir, "machine.id")
        f = file(machine_id_file, "w")
        print >> f, "TESTMACHINE"
        f.close()
        self.config().change_user_id("UPLOADTEST")
        self.config()["max_log_size_before_upload"] = 1
        MnemosyneTest.teardown(self)

        self.mnemosyne = Mnemosyne(upload_science_logs=True, interested_in_old_reps=True,
            asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_logging", "MyMainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.mnemosyne.start_review()
        MnemosyneTest.teardown(self)

        self.mnemosyne = Mnemosyne(upload_science_logs=True, interested_in_old_reps=True,
            asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_logging", "MyMainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.mnemosyne.start_review()
        MnemosyneTest.teardown(self)

        self.mnemosyne = Mnemosyne(upload_science_logs=True, interested_in_old_reps=True,
            asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_logging", "MyMainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.mnemosyne.start_review()
开发者ID:tpizzle,项目名称:mnemosyne,代码行数:43,代码来源:test_logging.py


示例14: setup

 def setup(self):
     self.initialise_data_dir()
     self.mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True, asynchronous_database=True)
     self.mnemosyne.components.insert(
         0, ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator")
     )
     self.mnemosyne.components.append(("mnemosyne_test", "TestReviewWidget"))
     self.mnemosyne.components.append(("test_smconv_import", "Widget"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
     self.review_controller().reset()
开发者ID:tbabej,项目名称:mnemosyne,代码行数:10,代码来源:test_smconv_import.py


示例15: __init__

 def __init__(self):
     Thread.__init__(self)
     self.mnemosyne = Mnemosyne()
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(("test_sync", "Widget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.dialogs", "ProgressDialog"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
开发者ID:bartosh,项目名称:pomni,代码行数:10,代码来源:benchmark_sync.py


示例16: restart

 def restart(self):
     self.mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True,
         asynchronous_database=True)
     self.mnemosyne.components.insert(0,
        ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("test_logging", "MyMainWidget"))
     self.mnemosyne.components.append(\
         ("mnemosyne_test", "TestReviewWidget"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
     self.mnemosyne.start_review()
开发者ID:tpizzle,项目名称:mnemosyne,代码行数:11,代码来源:test_logging.py


示例17: setup

 def setup(self):
     os.system("rm -fr dot_test")
     
     self.mnemosyne = Mnemosyne()
     self.mnemosyne.components.insert(0, ("mnemosyne.libmnemosyne.translator",
                          "GetTextTranslator"))
     self.mnemosyne.components.append(\
         ("test_add_cards", "Widget"))
     self.mnemosyne.components.append(\
         ("mnemosyne.libmnemosyne.ui_components.review_widget", "ReviewWidget"))
     self.mnemosyne.initialise(os.path.abspath("dot_test"))
     self.review_controller().reset()
开发者ID:bartosh,项目名称:pomni,代码行数:12,代码来源:test_add_cards.py


示例18: test_log_upload_bad_server

    def test_log_upload_bad_server(self):
        # Most reliable way of setting this variable is throug config.py, otherwise
        # it will stay alive in a dangling imported userconfig.
        config_py_file = os.path.join(self.mnemosyne.config().config_dir, "config.py")
        f = file(config_py_file, "w")
        print >> f, "science_server = \"noserver:80\""
        f.close()

        machine_id_file = os.path.join(self.mnemosyne.config().config_dir, "machine.id")
        f = file(machine_id_file, "w")
        print >> f, "TESTMACHINE"
        f.close()
        self.config().change_user_id("UPLOADTEST")
        self.config()["max_log_size_before_upload"] = 1
        MnemosyneTest.teardown(self)

        self.mnemosyne = Mnemosyne(upload_science_logs=True, interested_in_old_reps=True,
            asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_logging", "MyMainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.mnemosyne.start_review()
        MnemosyneTest.teardown(self)

        self.mnemosyne = Mnemosyne(upload_science_logs=True, interested_in_old_reps=True,
            asynchronous_database=True)
        self.mnemosyne.components.insert(0,
           ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator"))
        self.mnemosyne.components.append(\
            ("test_logging", "MyMainWidget"))
        self.mnemosyne.components.append(\
            ("mnemosyne_test", "TestReviewWidget"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.mnemosyne.start_review()
开发者ID:tpizzle,项目名称:mnemosyne,代码行数:38,代码来源:test_logging.py


示例19: setup

    def setup(self):
        global expected_scheduled_count
        expected_scheduled_count = None
        self.initialise_data_dir()

        self.mnemosyne = Mnemosyne(upload_science_logs=False, interested_in_old_reps=True, asynchronous_database=True)
        self.mnemosyne.components.insert(
            0, ("mnemosyne.libmnemosyne.translators.gettext_translator", "GetTextTranslator")
        )
        self.mnemosyne.components.append(("mnemosyne.libmnemosyne.ui_components.main_widget", "MainWidget"))
        self.mnemosyne.components.append(("test_review_controller", "MyReviewWidget"))
        self.mnemosyne.components.append(("mnemosyne.libmnemosyne.ui_components.dialogs", "EditCardDialog"))
        self.mnemosyne.initialise(os.path.abspath("dot_test"), automatic_upgrades=False)
        self.review_controller().reset()
开发者ID:tbabej,项目名称:mnemosyne,代码行数:14,代码来源:test_review_controller.py


示例20: startup

def startup():

    global mnemosyne

    # Note that this also includes building the queue and getting the first card.

    mnemosyne = Mnemosyne(resource_limited=True)
    mnemosyne.components = [
        ("mnemosyne.libmnemosyne.translator",
         "NoTranslation"),
        ("mnemosyne.libmnemosyne.ui_components.main_widget",
         "MainWidget"),
        ("mnemosyne.libmnemosyne.ui_components.review_widget",
         "ReviewWidget"),
        ("mnemosyne.libmnemosyne.databases.SQLite",
         "SQLite"),               
        ("mnemosyne.libmnemosyne.configuration",
         "Configuration"),          
        ("mnemosyne.libmnemosyne.loggers.sql_logger",
         "SqlLogger"),          
        ("mnemosyne.libmnemosyne.schedulers.SM2_mnemosyne",
         "SM2Mnemosyne"),
        ("mnemosyne.libmnemosyne.stopwatch",
          "Stopwatch"),
        ("mnemosyne.libmnemosyne.card_types.front_to_back",
         "FrontToBack"),
        ("mnemosyne.libmnemosyne.card_types.both_ways",
         "BothWays"),
        ("mnemosyne.libmnemosyne.card_types.three_sided",
         "ThreeSided"),
        ("mnemosyne.libmnemosyne.renderers.html_css_old",
         "HtmlCssOld"),
        ("mnemosyne.libmnemosyne.filters.escape_to_html",
         "EscapeToHtml"),
        ("mnemosyne.libmnemosyne.filters.expand_paths",
         "ExpandPaths"),
        ("mnemosyne.libmnemosyne.filters.latex",
         "Latex"),
        ("mnemosyne.libmnemosyne.controllers.default_controller",
         "DefaultController"),
        ("mnemosyne.libmnemosyne.review_controllers.SM2_controller",
         "SM2Controller"),
        ("mnemosyne.libmnemosyne.card_types.map",
         "MapPlugin"),
        ("mnemosyne.libmnemosyne.card_types.cloze",
         "ClozePlugin"),
        ("mnemosyne.libmnemosyne.plugins.cramming_plugin",
         "CrammingPlugin"),
        ("mnemosyne.libmnemosyne.file_formats.mnemosyne1_mem",
          "Mnemosyne1Mem"),
        ("mnemosyne.libmnemosyne.ui_components.dialogs",
         "ProgressDialog") ]    

    mnemosyne.initialise(basedir=os.path.abspath("dot_benchmark"))
    #mnemosyne.initialise(basedir="\SDMMC\.mnemosyne")

    mnemosyne.review_controller().reset()
开发者ID:vasvlad,项目名称:pomni,代码行数:57,代码来源:benchmark.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python translator._函数代码示例发布时间:2022-05-27
下一篇:
Python mnemonic.Mnemonic类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap