summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
authorbwarsaw2007-05-28 20:21:41 +0000
committerbwarsaw2007-05-28 20:21:41 +0000
commitb18f632faa6de17badabb3c6c7ba61752ac84c37 (patch)
tree8b444330b288c5dfc9b25be639d429abfaeb3d3d /Mailman/Utils.py
parent5ff792b13599920527b48f92f8bad880668f8f26 (diff)
downloadmailman-b18f632faa6de17badabb3c6c7ba61752ac84c37.tar.gz
mailman-b18f632faa6de17badabb3c6c7ba61752ac84c37.tar.zst
mailman-b18f632faa6de17badabb3c6c7ba61752ac84c37.zip
Merge exp-elixir-branch to trunk. There is enough working to make me feel
confident the Elixir branch is ready to become mainline. Also, fewer branches makes for an easier migration to a dvcs. Don't expect much of the old test suite to work, or even for much of the old functionality to work. The changes here are disruptive enough to break higher level parts of Mailman. But that's okay because I am slowly building up a new and improved test suite, which will lead to a functional system again. For now, only the doctests in Mailman/docs (and their related test harnesses) will pass, but they all do pass. Note that Mailman/docs serve as system documentation first and unit tests second. You should be able to read the doctest files to understand the underlying data model. Other changes included in this merge: - Added the Mailman.ext extension package. - zope.interfaces uses to describe major components - SQLAlchemy/Elixir used as the database model - Top level doinstall target renamed to justinstall - 3rd-party packages are now installed in pythonlib/lib/python to be more compliant with distutils standards. This allows us to use just --home instead of all the --install-* options. - No longer need to include the email package or pysqlite, as Python 2.5 is required (and comes with both packages). - munepy package is included, for Python enums - IRosterSets are added as a way to manage a collection of IRosters. Roster sets are named so that we can maintain the indirection between mailing lists and rosters, where the two are maintained in different storages. - IMailingListRosters: remove_*_roster() -> delete_*_roster() - Remove IMember interface. - Utils.list_names() -> config.list_manager.names - fqdn_listname() takes an optional hostname argument. - Added a bunch of new exceptions used throughout the new interfaces. - Make LockFile a context manager for use with the 'with' statement.
Diffstat (limited to 'Mailman/Utils.py')
-rw-r--r--Mailman/Utils.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index afb2f1fd5..27a61567e 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -40,7 +40,6 @@ from email.Errors import HeaderParseError
from string import ascii_letters, digits, whitespace
from Mailman import Errors
-from Mailman import database
from Mailman import passwords
from Mailman.SafeDict import SafeDict
from Mailman.configuration import config
@@ -66,13 +65,13 @@ log = logging.getLogger('mailman.error')
def list_exists(fqdn_listname):
"""Return true iff list `fqdn_listname' exists."""
listname, hostname = split_listname(fqdn_listname)
- return bool(database.find_list(listname, hostname))
+ return bool(config.list_manager.find_list(listname, hostname))
def list_names():
"""Return the fqdn names of all lists in default list directory."""
return ['%s@%s' % (listname, hostname)
- for listname, hostname in database.get_list_names()]
+ for listname, hostname in config.list_manager.get_list_names()]
def split_listname(listname):
@@ -81,8 +80,10 @@ def split_listname(listname):
return listname, config.DEFAULT_EMAIL_HOST
-def fqdn_listname(listname):
- return AT.join(split_listname(listname))
+def fqdn_listname(listname, hostname=None):
+ if hostname is None:
+ return AT.join(split_listname(listname))
+ return AT.join((listname, hostname))