Document the fact that add_handlers should only be called once for each

host_pattern.
This commit is contained in:
Ben Darnell 2010-08-26 11:31:54 -07:00
parent 318ec31c3d
commit c4413f5b63
1 changed files with 7 additions and 1 deletions

View File

@ -1018,7 +1018,13 @@ class Application(object):
autoreload.start()
def add_handlers(self, host_pattern, host_handlers):
"""Appends the given handlers to our handler list."""
"""Appends the given handlers to our handler list.
Note that host patterns are processed sequentially in the
order they were added, and only the first matching pattern is
used. This means that all handlers for a given host must be
added in a single add_handlers call.
"""
if not host_pattern.endswith("$"):
host_pattern += "$"
handlers = []