From a00d123297b1cc025f381fda3474dbc0d96e077a Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Fri, 15 Feb 2019 19:02:05 -0500 Subject: [PATCH] Update plugins for picard 2 --- no-remote-plugins.py | 16 +++++++++++----- tweak-filename-filter.py | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/no-remote-plugins.py b/no-remote-plugins.py index 68c384b..9f7908b 100644 --- a/no-remote-plugins.py +++ b/no-remote-plugins.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- # +# Copyright © 2018-2019 Nick Bowler +# # License GPLv3+: GNU General Public License version 3 or any later version. # This is free software: you are free to change and redistribute it. # There is NO WARRANTY, to the extent permitted by law. @@ -10,18 +12,22 @@ PLUGIN_DESCRIPTION = u'''

This plugin disables querying the MusicBrainz server for plugins. This avoids network activity at startup and prevents the options dialog from suggesting non-free plugins for installation.

''' -PLUGIN_VERSION = "0" -PLUGIN_API_VERSIONS = ["1.0"] +PLUGIN_VERSION = "1.1" +PLUGIN_API_VERSIONS = ["1.0", "2.0"] PLUGIN_LICENSE = "GPL-3.0-or-later" from picard import (config, log, plugin) -from PyQt4 import QtCore + +try: + from PyQt5 import QtCore +except (RuntimeError, ImportError): + from PyQt4 import QtCore + import types def modulename(): return modulename.__module__[len("picard.plugins."):] -# class ReplPluginManager(plugin.PluginManager): def repl_query(self, callback=None): pass @@ -34,4 +40,4 @@ def install_hooks(): if modulename() in config.setting["enabled_plugins"]: install_hooks() else: - log.debug("%s disabled in configuration" % (modulename())); + log.debug("%s disabled in configuration" % (modulename())) diff --git a/tweak-filename-filter.py b/tweak-filename-filter.py index 6f81515..5777bb7 100644 --- a/tweak-filename-filter.py +++ b/tweak-filename-filter.py @@ -23,8 +23,8 @@ true) ''' -PLUGIN_VERSION = "0" -PLUGIN_API_VERSIONS = ["1.0"] +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["1.0", "2.0"] PLUGIN_LICENSE = "GPL-3.0-or-later" from picard import (config, log) @@ -59,4 +59,4 @@ config.BoolOption("setting", "tweak_file_replace_backslash", True), if modulename() in config.setting["enabled_plugins"]: install_tweaker() else: - log.debug("%s disabled in configuration" % (modulename())); + log.debug("%s disabled in configuration" % (modulename())) -- 2.43.0