pip install -U <plugin-name>
The ``-U`` tells pip to upgrade the package.
+
+
+Troubleshooting plugins
+=======================
+
+Sometimes plugins just don't work right. When you're having problems
+with plugins, think about the following:
+
+1. Check the log files.
+
+ Some plugins will log errors to the log files and you can use that
+ to diagnose the problem.
+
+2. Try running MediaGoblin without that plugin.
+
+ It's easy to disable a plugin from MediaGoblin. Add a ``-`` to the
+ name in your config file.
+
+ For example, change::
+
+ [[mediagoblin.plugins.flatpages]]
+
+ to::
+
+ [[-mediagoblin.plugins.flatpages]]
+
+ That'll prevent the ``mediagoblin.plugins.flatpages`` plugin from
+ loading.
+
+3. If it's a core plugin that comes with MediaGoblin, ask us for help!
+
+ If it's a plugin you got from somewhere else, ask them for help!
# Go through and import all the modules that are subsections of
# the [plugins] section and read in the hooks.
for plugin_module, config in plugin_section.items():
+ # Skip any modules that start with -. This makes it easier for
+ # someone to tweak their configuration so as to not load a
+ # plugin without having to remove swaths of plugin
+ # configuration.
+ if plugin_module.startswith('-'):
+ continue
+
_log.info("Importing plugin module: %s" % plugin_module)
pman.register_plugin(plugin_module)
# If this throws errors, that's ok--it'll halt mediagoblin
# Make sure _setup_plugin_called was called once
import mediagoblin.plugins.sampleplugin
eq_(mediagoblin.plugins.sampleplugin._setup_plugin_called, 1)
+
+
+@with_cleanup()
+def test_disabled_plugin():
+ """Run setup_plugins with a single working plugin twice"""
+ cfg = build_config([
+ ('mediagoblin', {}, []),
+ ('plugins', {}, [
+ ('-mediagoblin.plugins.sampleplugin', {}, []),
+ ])
+ ])
+
+ mg_globals.app_config = cfg['mediagoblin']
+ mg_globals.global_config = cfg
+
+ pman = pluginapi.PluginManager()
+ setup_plugins()
+
+ # Make sure we didn't load the plugin
+ eq_(len(pman.plugins), 0)