Use python abc for abstract classes

Instead of raising NotImplementedErrors in abstract methods, mark them as
abstract using python abc class [1].
See also [2]

[1]: http://legacy.python.org/dev/peps/pep-3119/
[2]: http://dbader.org/blog/abstract-base-classes-in-python

Change-Id: Ief9eefc2ae87526248b91abd04b6e62ad94fbf35
Partial-Bug: #1346797
This commit is contained in:
Daniel Gonzalez 2015-02-07 01:42:49 +01:00
parent 29dd42e923
commit d6db8025a3
1 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@
Utility methods for working with WSGI servers
"""
import abc
import errno
import json
import logging
@ -771,6 +772,7 @@ def translate_exception(exc, locale):
return exc
@six.add_metaclass(abc.ABCMeta)
class BasePasteFactory(object):
"""A base class for paste app and filter factories.
@ -784,8 +786,9 @@ class BasePasteFactory(object):
def __init__(self, conf):
self.conf = conf
@abc.abstractmethod
def __call__(self, global_conf, **local_conf):
raise NotImplementedError
return
def _import_factory(self, local_conf):
"""Import an app/filter class.