Download this file

sample.py    27 lines (17 with data), 541 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import logging
from lamson.routing import route, route_like, stateless
from config.settings import relay
from lamson import view
@route("(address)@(host)", address=".+")
def START(message, address=None, host=None):
return NEW_USER
@route_like(START)
def NEW_USER(message, address=None, host=None):
return NEW_USER
@route_like(START)
def END(message, address=None, host=None):
return NEW_USER(message, address, host)
@route_like(START)
@stateless
def FORWARD(message, address=None, host=None):
relay.deliver(message)