1
# Twisted, the Framework of Your Internet
2
# Copyright (C) 2001 Matthew W. Lefkowitz
4
# This library is free software; you can redistribute it and/or
5
# modify it under the terms of version 2.1 of the GNU Lesser General Public
6
# License as published by the Free Software Foundation.
8
# This library is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
# Lesser General Public License for more details.
13
# You should have received a copy of the GNU Lesser General Public
14
# License along with this library; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from Tkinter import Tk,mainloop
18
from twisted.spread.ui import tkutil
19
from twisted.internet import tkinternet
20
from twisted.words.ui import im2,tkim
21
from twisted.words.ui.gateways import toc
22
from twisted.internet import tcp
24
im2.Conversation=tkim.Conversation
25
im2.ContactList=tkim.ContactList
26
im2.GroupSession=tkim.GroupSession
28
def our_callback(values):
31
user=values["username"]
32
password=values["password"]
33
server=values["server"]
34
port=int(values["port"])
35
c=toc.TOCGateway(im,user,password)
36
tcp.Client(server,port,c)
43
tkinternet.install(root)
44
im=im2.InstanceMessenger()
46
tkutil.GenericLogin(our_callback,[["Username","my_screen_name"],
47
["Password","my_password",{"show":"*"}],
48
["Server","toc.oscar.aol.com"],
53
if __name__=="__main__":main()