Пример #1
0
def init_plugins(no_plugins=False):
    print_d("Starting plugin manager")

    from quodlibet import plugins
    folders = [os.path.join(get_base_dir(), "ext", kind)
               for kind in PLUGIN_DIRS]
    folders.append(os.path.join(get_user_dir(), "plugins"))
    print_d("Scanning folders: %s" % folders)
    pm = plugins.init(folders, no_plugins)
    pm.rescan()

    from quodlibet.qltk.edittags import EditTags
    from quodlibet.qltk.renamefiles import RenameFiles
    from quodlibet.qltk.tagsfrompath import TagsFromPath
    EditTags.init_plugins()
    RenameFiles.init_plugins()
    TagsFromPath.init_plugins()

    return pm
Пример #2
0
def init_plugins(no_plugins=False):
    print_d("Starting plugin manager")

    from quodlibet import plugins
    folders = [os.path.join(quodlibet.const.BASEDIR, "plugins", "editing"),
               os.path.join(quodlibet.const.BASEDIR, "plugins", "events"),
               os.path.join(quodlibet.const.BASEDIR, "plugins", "playorder"),
               os.path.join(quodlibet.const.BASEDIR, "plugins", "songsmenu"),
               os.path.join(quodlibet.const.BASEDIR, "plugins", "gstreamer"),
               os.path.join(quodlibet.const.USERDIR, "plugins")]
    pm = plugins.init(folders, no_plugins)
    pm.rescan()

    from quodlibet.qltk.edittags import EditTags
    from quodlibet.qltk.renamefiles import RenameFiles
    from quodlibet.qltk.tagsfrompath import TagsFromPath
    EditTags.init_plugins()
    RenameFiles.init_plugins()
    TagsFromPath.init_plugins()

    return pm
Пример #3
0
    def test_edit_tags_popup_menu(self):
        song = AudioFile({"~filename": "/dev/null", "artist": "Person",
                          "album": "Dj Bars of FOO"})
        props = SongProperties(app.library, [song], app.window)
        box = EditTags(props, app.library)

        # Add a fake plugin
        plugin_cls = DummyEditPlugin
        box.handler = Mock(EditTagsPluginHandler)
        box.handler.plugins = [plugin_cls]
        model = box._view.get_model()

        # Make sure there's a row
        tag, value = "artist", song("artist")
        entry = ListEntry(tag, Comment(value))
        model.append(row=[entry])

        box._group_info = AudioFileGroup([song])
        box._view.select_by_func(lambda _: True)
        # Prevent weird mouse stuff failing in tests
        box._view.ensure_popup_selection = lambda: False
        box._popup_menu(box._view, props)
        box.show()
        assert plugin_cls.activations == [(tag, value)]
Пример #4
0
 def test_edit_tags_starts(self):
     props = SongProperties(app.library, [], quodlibet.app.window)
     EditTags(props, app.library)