LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-"""
-
+"""\
"""
CAVEAT:
This is a minimal implementation of python-pluggy (based on 0.8.0 interface:
TODO: Once this becomes available in the above distros, this file should be
REMOVED, and the fully featured python-pluggy should be used instead.
"""
+try:
+ from typing import DefaultDict
+except ImportError:
+ pass # For typing only
class HookspecMarker(object):
"""
def __init__(self):
from collections import defaultdict
- self._registry = defaultdict(list)
+ self._registry = defaultdict(list) # type: DefaultDict[str, list]
def __getattr__(self, hook_name):
return lambda *args, **kwargs: [
def add_hookspecs(self, module_or_class):
""" Dummy method"""
- pass
- def register(self, plugin, name=None):
+ def register(self, plugin, name=None): # pylint: disable=unused-argument
for attr in dir(plugin):
if self.parse_hookimpl_opts(plugin, attr) is not None:
+ # pylint: disable=protected-access
self.hook._add_hookimpl(attr, getattr(plugin, attr))