~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/examples/postfix.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

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'