]> git.draconx.ca Git - picard-plugins.git/blob - no-remote-plugins.py
Initial commit
[picard-plugins.git] / no-remote-plugins.py
1 # -*- coding: utf-8 -*-
2 #
3 # License GPLv3+: GNU General Public License version 3 or any later version.
4 # This is free software: you are free to change and redistribute it.
5 # There is NO WARRANTY, to the extent permitted by law.
6
7 PLUGIN_NAME = u"No remote plugins"
8 PLUGIN_AUTHOR = u"Nick Bowler"
9 PLUGIN_DESCRIPTION = u'''<p>This plugin disables querying the MusicBrainz
10 server for plugins.  This avoids network activity at startup and prevents
11 the options dialog from suggesting non-free plugins for installation.</p>
12 '''
13 PLUGIN_VERSION = "0"
14 PLUGIN_API_VERSIONS = ["1.0"]
15 PLUGIN_LICENSE = "GPL-3.0-or-later"
16
17 from picard import (config, log, plugin)
18 from PyQt4 import QtCore
19 import types
20
21 def modulename():
22     return modulename.__module__[len("picard.plugins."):]
23
24 # class ReplPluginManager(plugin.PluginManager):
25 def repl_query(self, callback=None):
26     pass
27
28 tagger = QtCore.QObject.tagger
29 def install_hooks():
30     tagger.pluginmanager.query_available_plugins = \
31         types.MethodType(repl_query, plugin.PluginManager)
32     log.info("%s activated" % (modulename()))
33
34 if modulename() in config.setting["enabled_plugins"]:
35     install_hooks()
36 else:
37     log.debug("%s disabled in configuration" % (modulename()));