1
# Copyright (c) 2008 Divmod. See LICENSE for details.
4
An AMP client which connects to and authenticates with an AMP server using OTP,
8
from twisted.internet.protocol import ClientCreator
9
from twisted.cred.credentials import UsernamePassword
10
from twisted.protocols.amp import AMP
12
from epsilon.react import react
13
from epsilon.ampauth import OTPLogin
15
from auth_server import Add
19
return proto.callRemote(Add, left=17, right=33)
27
client.callRemote(OTPLogin, pad='pad')
32
cc = ClientCreator(reactor, AMP)
33
d = cc.connectTCP('localhost', 7805)
34
d.addCallback(otpLogin)
36
d.addCallback(display)
40
if __name__ == '__main__':
41
from twisted.internet import reactor
42
react(reactor, main, [])