def getIrcView(): global _view if not _view: from twisted.internet.ingtkernet import install install() # install twisted bindings _view = ircView() return _view
# License as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # System Imports import gtk import time from twisted.internet import ingtkernet ingtkernet.install() # Twisted Imports from twisted.spread import pb from twisted.spread.ui import gtkutil from twisted.words.ui import im class Group(pb.RemoteCache): """A local cache of a group. """ pb.setCopierForClass("twisted.words.service.Group", Group)
# modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from twisted.internet import ingtkernet from twisted.spread.ui import gtkutil import gtk ingtkernet.install() class EchoClient: def __init__(self, echoer): l.hide() self.echoer = echoer w = gtk.GtkWindow(gtk.WINDOW_TOPLEVEL) vb = gtk.GtkVBox(); b = gtk.GtkButton("Echo:") self.entry = gtk.GtkEntry(); self.outry = gtk.GtkEntry() w.add(vb) map(vb.add, [b, self.entry, self.outry]) b.connect('clicked', self.clicked) w.connect('destroy', gtk.mainquit) w.show_all() def clicked(self, b): txt = self.entry.get_text() self.entry.set_text("")
pass if event.type == GDK._2BUTTON_PRESS: # check if chat already present id = self.messenger.create_session() print "ID", id, type(id) c = gtksession(self.handle) c.invite(handle) self.pending[id] = c return 1 if __name__ == '__main__': import os, sys handle = "" password = "" if os.environ.has_key('MSNHANDLE'): handle = os.environ['MSNHANDLE'] if os.environ.has_key('MSNPASSWORD'): password = os.environ['MSNPASSWORD'] if len(sys.argv) == 3: handle = sys.argv[1] password = sys.argv[2] a = gtkapp(handle, password) install() # install twisted gtk thingy mainloop()