~certify-web-dev/twisted/certify-staging

« back to all changes in this revision

Viewing changes to doc/examples/postfix.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-01-02 19:38:17 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100102193817-jphp464ppwh7dulg
Tags: 9.0.0-1
* python-twisted: Depend on the python-twisted-* 9.0 packages.
* python-twisted: Depend on python-zope.interface only. Closes: #557781.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2009 Twisted Matrix Laboratories.
 
2
# See LICENSE for details.
 
3
 
 
4
"""
 
5
Test app for PostfixTCPMapServer.
 
6
 
 
7
Call with parameters KEY1=VAL1 KEY2=VAL2 ...
 
8
"""
 
9
 
 
10
import sys
 
11
 
 
12
from twisted.internet import reactor
 
13
from twisted.protocols import postfix
 
14
from twisted.python import log
 
15
 
 
16
log.startLogging(sys.stdout)
 
17
 
 
18
d = {}
 
19
for arg in sys.argv[1:]:
 
20
    try:
 
21
        k,v = arg.split('=', 1)
 
22
    except ValueError:
 
23
        k = arg
 
24
        v = ''
 
25
    d[k] = v
 
26
    
 
27
f = postfix.PostfixTCPMapDictServerFactory(d)
 
28
port = reactor.listenTCP(4242, f, interface='127.0.0.1')
 
29
reactor.run()
 
 
b'\\ No newline at end of file'