Ejemplo n.º 1
0
    def topic(self, channel, topic=None):
        channel = encode(channel)
        if topic is not None:
            topic = encode(topic)

        d = self.topicDeferreds.get(channel)
        if d is None:
            d = self.topicDeferreds[channel] = Deferred()
        IRCClient.topic(self, channel, topic)
        return d
Ejemplo n.º 2
0
def tinyurl(uri):
    #u = url.URL.fromString(API).child('create.php').add('url', uri)
    # XXX: Sigh. TinyURL makes it very obvious that it was written in PHP by
    # a retard. Quoted characters never get unquoted and then you get broken
    # URLs. Kevin Gilbertson, please burn in hell for eternity while having
    # ants bite your urethra.
    u = str(
        url.URL.fromString(API).child('create.php')) + '?url=' + encode(uri)
    return getPage(u).addCallback(extractTinyUrl)
Ejemplo n.º 3
0
    def __init__(self, appStore, serviceID, factory, portal, config):
        self.serviceID = serviceID
        self.factory = factory
        self.portal = portal
        self.config = config
        self.appStore = appStore
        self.nickname = encode(config.nickname)

        self.topicDeferreds = {}
        self.isupported = {}
        self.authenticatedUsers = {}
Ejemplo n.º 4
0
    def signedOn(self):
        log.msg('Signed on.')
        self.factory.resetDelay()

        self.setModes()

        channels = self.config.channels
        for channel in channels:
            self.join(encode(channel))

        log.msg('Joined channels: %r' % (channels,))
Ejemplo n.º 5
0
 def say(self, text):
     """
     Say C{text} in the current channel (or private) over the protocol.
     """
     self.protocol.msg(encode(self.channel), encode(text))
Ejemplo n.º 6
0
 def privateNotice(self, text):
     """
     Send a private I{NOTICE} to L{self.user}.
     """
     self.protocol.notice(encode(self.user.nickname), encode(text))
Ejemplo n.º 7
0
 def notice(self, text):
     """
     Notice C{text} to the current channel.
     """
     self.protocol.notice(encode(self.channel), encode(text))
Ejemplo n.º 8
0
 def part(self, channel):
     self.config.removeChannel(channel)
     return IRCClient.part(self, encode(channel))
Ejemplo n.º 9
0
 def join(self, channel, key=None):
     self.config.addChannel(channel)
     return IRCClient.join(self, encode(channel), key)
Ejemplo n.º 10
0
 def say(self, text):
     """
     Say C{text} in the current channel (or private) over the protocol.
     """
     self.protocol.msg(encode(self.channel), encode(text))
Ejemplo n.º 11
0
 def privateNotice(self, text):
     """
     Send a private I{NOTICE} to L{self.user}.
     """
     self.protocol.notice(encode(self.user.nickname), encode(text))
Ejemplo n.º 12
0
 def notice(self, text):
     """
     Notice C{text} to the current channel.
     """
     self.protocol.notice(encode(self.channel), encode(text))