~stefanor/ibid/exchange-336443

« back to all changes in this revision

Viewing changes to ibid/plugins/irc.py

  • Committer: Stefano Rivera
  • Date: 2009-03-10 00:04:23 UTC
  • mfrom: (561.2.4 trunk)
  • Revision ID: stefano@rivera.za.net-20090310000423-fwk4dons0e5uir2o
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
            channel = event.channel
26
26
 
27
27
        if source.lower() not in ibid.sources:
28
 
            event.addresponse(u"I don't have a source called %s" % source.lower())
 
28
            event.addresponse(u"I don't have a source called %s", source.lower())
29
29
            return
30
30
 
31
31
        source = ibid.sources[source.lower()]
32
32
 
33
33
        if not hasattr(source, 'join'):
34
 
            event.addresponse(u"%s cannot join/part channels" % (source.name,))
 
34
            event.addresponse(u'%s cannot join/part channels', source.name)
35
35
            return
36
36
 
37
37
        if action == 'join':
38
38
            source.join(channel)
39
 
            event.addresponse(u"Joining %s" % channel)
 
39
            event.addresponse(u'Joining %s', channel)
40
40
        else:
41
41
            source.part(channel)
42
 
            event.addresponse(u"Parting %s" % channel)
 
42
            event.addresponse(u'Parting %s', channel)
43
43
 
44
44
    @match(r'^change\s+nick\s+to\s+(\S+)(?:\s+on\s+(\S+))?$')
45
45
    @authorise
49
49
            source = event.source
50
50
 
51
51
        if source.lower() not in ibid.sources:
52
 
            event.addresponse(u"I don't have a source called %s" % source.lower())
 
52
            event.addresponse(u"I don't have a source called %s", source.lower())
53
53
            return
54
54
 
55
55
        source = ibid.sources[source.lower()]
56
56
 
57
57
        if not hasattr(source, 'change_nick'):
58
 
            event.addresponse(u"%s cannot change nicks" % source)
 
58
            event.addresponse(u'%s cannot change nicks', source)
59
59
        else:
60
60
            source.change_nick(nick)
61
 
            event.addresponse(u'Changing nick to %s' % nick)
 
61
            event.addresponse(u'Changing nick to %s', nick)
62
62
 
63
63
# vi: set et sta sw=4 ts=4: