Merge lp:~nueces/lalita/support-private-channels into lp:lalita

Proposed by nueces
Status: Needs review
Proposed branch: lp:~nueces/lalita/support-private-channels
Merge into: lp:lalita
Diff against target: 62 lines (+35/-3)
2 files modified
lalita.cfg.sample (+28/-1)
lalita/ircbot.py (+7/-2)
To merge this branch: bzr merge lp:~nueces/lalita/support-private-channels
Reviewer Review Type Date Requested Status
Facundo Batista Needs Fixing
Review via email: mp+20866@code.launchpad.net

Description of the change

This branch provide support to joining private channels that are protected by password.

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) wrote :

This looks nice! However, some details:

- point at the end of the docstring

- remove blank in the ".get (...)"

And what it mandates a need fixing here: You need to provide test cases for this new feature.

Thank you very much!!

review: Needs Fixing

Unmerged revisions

138. By nueces

merge to sync with trunk

137. By nueces

Added support to joining private channels that are protected by password

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lalita.cfg.sample'
2--- lalita.cfg.sample 2010-02-21 23:17:33 +0000
3+++ lalita.cfg.sample 2010-03-07 15:49:17 +0000
4@@ -181,5 +181,32 @@
5 'encoding': 'utf8',
6 },
7 },
8- }
9+ },
10+ 'private-channel': dict(
11+ encoding='utf8',
12+ host='irc.freenode.net',
13+ port=6667,
14+ nickname='rosita',
15+ channels= {
16+ '#rosita-public': dict(
17+ plugins={
18+ 'url.Url': dict (database= 'url_public',),
19+ 'seen.Seen': {'base_dir':'./rosita/irc/logs/seen/public'},
20+ },
21+ ),
22+ '#rosita-private': dict(
23+ password='permiso',
24+ plugins={
25+ 'url.Url': dict (database= 'url_private',),
26+ 'seen.Seen': {'base_dir':'./rosita/irc/logs/seen/private'},
27+ },
28+ ),
29+ },
30+ plugins= {
31+ 'freenode.Register': { 'password': '' },
32+ 'url.Url': dict ( database= 'url_public',),
33+ 'seen.Seen': {'base_dir':'./rosita/irc/logs/seen/default'},
34+ 'misc.Ping': { },
35+ },
36+ ),
37 }
38
39=== modified file 'lalita/ircbot.py'
40--- lalita/ircbot.py 2010-02-20 15:02:51 +0000
41+++ lalita/ircbot.py 2010-03-07 15:49:17 +0000
42@@ -115,13 +115,18 @@
43 self.dispatcher.push(events.CONNECTION_LOST)
44
45 def signedOn(self):
46+ """This is called to join a channel"""
47 logger.debug("signed on %s:%d",
48 self.config['host'], self.config['port'])
49 self.dispatcher.push(events.SIGNED_ON)
50- for channel in self.config.get ('channels', []):
51+ for channel, options in self.config.get ('channels', {}).iteritems():
52+ password = options.get('password', '').strip()
53+ if password:
54+ channel = '%s %s' % (channel, password)
55+
56 logger.debug("joining %s on %s:%d",
57 channel, self.config['host'], self.config['port'])
58- self.join (channel)
59+ self.join(channel)
60
61 def receivedMOTD(self, motd):
62 logger.debug("motd from %s:%d",

Subscribers

People subscribed via source and target branches

to all changes: