diff options
| author | Barry Warsaw | 2009-01-04 00:22:08 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-04 00:22:08 -0500 |
| commit | 59d2b6181ffa9517da97a6eb43a51396b1ff04f4 (patch) | |
| tree | 58f2a968e5ccaf86e3dbc3616e3d8ab60c244632 /mailman/interfaces/__init__.py | |
| parent | bad70b0046b5612bf1342703cf5de7580e66fb45 (diff) | |
| download | mailman-59d2b6181ffa9517da97a6eb43a51396b1ff04f4.tar.gz mailman-59d2b6181ffa9517da97a6eb43a51396b1ff04f4.tar.zst mailman-59d2b6181ffa9517da97a6eb43a51396b1ff04f4.zip | |
Remove the mailman.interface magic. Use the more specific interface imports.
Diffstat (limited to 'mailman/interfaces/__init__.py')
| -rw-r--r-- | mailman/interfaces/__init__.py | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/mailman/interfaces/__init__.py b/mailman/interfaces/__init__.py index c39dd55ad..a9f3fb982 100644 --- a/mailman/interfaces/__init__.py +++ b/mailman/interfaces/__init__.py @@ -15,48 +15,14 @@ # You should have received a copy of the GNU General Public License along with # GNU Mailman. If not, see <http://www.gnu.org/licenses/>. -import os -import sys - -from munepy import Enum -from zope.interface import implementedBy -from zope.interface.interfaces import IInterface - +__metaclass__ = type __all__ = [ 'Action', 'NewsModeration', ] - -def _populate(): - import mailman.interfaces - iface_mod = sys.modules['mailman.interfaces'] - # Expose interfaces defined in sub-modules into the top-level package - for filename in os.listdir(os.path.dirname(iface_mod.__file__)): - base, ext = os.path.splitext(filename) - if ext <> '.py': - continue - modname = 'mailman.interfaces.' + base - __import__(modname) - module = sys.modules[modname] - for name in dir(module): - obj = getattr(module, name) - try: - is_enum = issubclass(obj, Enum) - except TypeError: - is_enum = False - is_interface = IInterface.providedBy(obj) - try: - is_exception = issubclass(obj, Exception) - except TypeError: - is_exception = False - if is_interface or is_exception or is_enum: - setattr(iface_mod, name, obj) - __all__.append(name) - - -_populate() +from munepy import Enum |
