mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 14:24:17 +00:00
Delete unnecessary and dead code
This commit is contained in:
parent
f1010b7733
commit
d2f4e97c31
1 changed files with 3 additions and 20 deletions
|
|
@ -42,21 +42,6 @@ class Plugin(object):
|
||||||
r"""Call the plugin with \*args and \*\*kwargs."""
|
r"""Call the plugin with \*args and \*\*kwargs."""
|
||||||
return self.plugin(*args, **kwargs)
|
return self.plugin(*args, **kwargs)
|
||||||
|
|
||||||
def load(self, verify_requirements=False):
|
|
||||||
"""Retrieve the plugin for this entry-point.
|
|
||||||
|
|
||||||
This loads the plugin, stores it on the instance and then returns it.
|
|
||||||
It does not reload it after the first time, it merely returns the
|
|
||||||
cached plugin.
|
|
||||||
|
|
||||||
:param bool verify_requirements:
|
|
||||||
Whether or not to make setuptools verify that the requirements for
|
|
||||||
the plugin are satisfied.
|
|
||||||
:returns:
|
|
||||||
The plugin resolved from the entry-point.
|
|
||||||
"""
|
|
||||||
return self.plugin
|
|
||||||
|
|
||||||
def load_plugin(self, verify_requirements=False):
|
def load_plugin(self, verify_requirements=False):
|
||||||
"""Retrieve the plugin for this entry-point.
|
"""Retrieve the plugin for this entry-point.
|
||||||
|
|
||||||
|
|
@ -88,8 +73,7 @@ class Plugin(object):
|
||||||
|
|
||||||
def provide_options(self, optmanager, options, extra_args):
|
def provide_options(self, optmanager, options, extra_args):
|
||||||
"""Pass the parsed options and extra arguments to the plugin."""
|
"""Pass the parsed options and extra arguments to the plugin."""
|
||||||
plugin = self.load()
|
parse_options = getattr(self.plugin, 'parse_options', None)
|
||||||
parse_options = getattr(plugin, 'parse_options', None)
|
|
||||||
if parse_options is not None:
|
if parse_options is not None:
|
||||||
LOG.debug('Providing options to plugin "%s".', self.name)
|
LOG.debug('Providing options to plugin "%s".', self.name)
|
||||||
try:
|
try:
|
||||||
|
|
@ -107,14 +91,13 @@ class Plugin(object):
|
||||||
:returns:
|
:returns:
|
||||||
Nothing
|
Nothing
|
||||||
"""
|
"""
|
||||||
plugin = self.load()
|
add_options = getattr(self.plugin, 'add_options', None)
|
||||||
add_options = getattr(plugin, 'add_options', None)
|
|
||||||
if add_options is not None:
|
if add_options is not None:
|
||||||
LOG.debug(
|
LOG.debug(
|
||||||
'Registering options from plugin "%s" on OptionManager %r',
|
'Registering options from plugin "%s" on OptionManager %r',
|
||||||
self.name, optmanager
|
self.name, optmanager
|
||||||
)
|
)
|
||||||
plugin.add_options(optmanager)
|
add_options(optmanager)
|
||||||
|
|
||||||
|
|
||||||
class PluginManager(object):
|
class PluginManager(object):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue