yaypm - once again
YAYPM - Yet Another Yate Python Module.
It is based on Twisted asynchronous framework, allows to program in
"Twisted style" with defereds and as a bonus, with little help of python
generators, to "flatten" message loops efficiently. With twisted
asynchronous implementation of network protocols it makes powerful
prototyping tool. As an example here is a code sniplet that reads your
email:
def attachAndWaitForNotify(yate, targetid, source):
yield yate.dispatch(Message(
type = "message", name = "chan.attach",
attrs = {"userData": targetid,
"notify": targetid,
"source": source}))
getResult()
yield yate.onmsg("chan.notify", lambda m : m.attrs["targetid"] ==
targetid)
yate.ret(getResult(), True)
def handle(yate, callid, targetid):
logger.debug("imap.py")
yield go(attachAndWaitForNotify(yate, targetid,
"tts/voice_cstr_pl_em_diphone/Witaj w czytniku poczty elektronicznej"))
getResult()
yield go(connect("mail.tiger.com.pl", "maciejka", "xxxxx"))
(Continue reading)