diff options
| author | Barry Warsaw | 2009-01-25 13:01:41 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-25 13:01:41 -0500 |
| commit | eefd06f1b88b8ecbb23a9013cd223b72ca85c20d (patch) | |
| tree | 72c947fe16fce0e07e996ee74020b26585d7e846 /mailman/domain.py | |
| parent | 07871212f74498abd56bef3919bf3e029eb8b930 (diff) | |
| download | mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.gz mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.zst mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.zip | |
Diffstat (limited to 'mailman/domain.py')
| -rw-r--r-- | mailman/domain.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/mailman/domain.py b/mailman/domain.py deleted file mode 100644 index 4a7bef755..000000000 --- a/mailman/domain.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (C) 2008-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""Domains.""" - -from __future__ import unicode_literals - -__metaclass__ = type -__all__ = [ - 'Domain', - ] - -from urlparse import urljoin, urlparse -from zope.interface import implements - -from mailman.interfaces.domain import IDomain - - - -class Domain: - """Domains.""" - - implements(IDomain) - - def __init__(self, email_host, base_url=None, description=None, - contact_address=None): - """Create and register a domain. - - :param email_host: The host name for the email interface. - :type email_host: string - :param base_url: The optional base url for the domain, including - scheme. If not given, it will be constructed from the - `email_host` using the http protocol. - :type base_url: string - :param description: An optional description of the domain. - :type description: string - :type contact_address: The email address to contact a human for this - domain. If not given, postmaster@`email_host` will be used. - """ - self.email_host = email_host - self.base_url = (base_url - if base_url is not None - else 'http://' + email_host) - self.description = description - self.contact_address = (contact_address - if contact_address is not None - else 'postmaster@' + email_host) - self.url_host = urlparse(self.base_url).netloc - - def confirm_address(self, token=''): - """See `IDomain`.""" - return 'confirm-{0}@{1}'.format(token, self.email_host) - - def confirm_url(self, token=''): - """See `IDomain`.""" - return urljoin(self.base_url, 'confirm/' + token) |
