~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/words/im/proxyui.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
 
2
# See LICENSE for details.
 
3
 
 
4
#
 
5
 
 
6
from twisted.words.protocols.irc import IRC
 
7
from twisted.python import log
 
8
from twisted.internet.protocol import Factory
 
9
 
 
10
class IRCUserInterface(IRC):
 
11
    def connectionLost(self):
 
12
        del self.factory.ircui
 
13
 
 
14
class IRCUIFactory(Factory):
 
15
    ircui = None
 
16
    def buildProtocol(self):
 
17
        if self.ircui:
 
18
            log.msg("already logged in")
 
19
            return None
 
20
        i = IRCUserInterface()
 
21
        i.factory = self
 
22
        self.ircui = i
 
23
        return i
 
24