Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Apr 28, 2012
1 parent b9eb08f commit ccf4ecb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inbox.py
Expand Up @@ -17,6 +17,7 @@


class InboxServer(smtpd.SMTPServer, object):
"""Logging-enabled SMTPServer instance with handler support."""

def __init__(self, handler, *args, **kwargs):
super(InboxServer, self).__init__(*args, **kwargs)
Expand All @@ -37,10 +38,12 @@ def __init__(self, port=None, address=None):
self.collator = None

def collate(self, collator):
"""Function decorator. Used to specify inbox handler."""
self.collator = collator
return collator

def serve(self, port=None, address=None):
"""Serves the SMTP server on the given port and address."""
port = port or self.port
address = address or self.address

Expand All @@ -54,6 +57,7 @@ def serve(self, port=None, address=None):
log.info('Cleaning up')

def dispatch(self):
"""Command-line dispatch."""
parser = argparse.ArgumentParser(description='Run an Inbox server.')

parser.add_argument('addr', metavar='addr', type=str, help='addr to bind to')
Expand Down

0 comments on commit ccf4ecb

Please sign in to comment.