Merge lp:~eridanus-developers/eridanus/grant-install-avatar into lp:eridanus

Proposed by Tristan Seligmann
Status: Merged
Approved by: Jonathan Jacobs
Approved revision: 200
Merged at revision: 198
Proposed branch: lp:~eridanus-developers/eridanus/grant-install-avatar
Merge into: lp:eridanus
Diff against target: 166 lines (+20/-8)
12 files modified
axiom/plugins/eridanuscmd.py (+5/-0)
bin/fixinitialcomment.py (+1/-1)
bin/killbrokenmanagers.py (+0/-1)
bin/setconfigname.py (+0/-1)
eridanus/avatar.py (+1/-0)
eridanus/bot.py (+2/-2)
eridanus/iriparse.py (+2/-0)
eridanus/plugin.py (+1/-1)
eridanus/reparse.py (+2/-0)
eridanus/test/plugin_broken.py (+1/-0)
eridanus/test/test_plugin.py (+5/-0)
eridanus/test/test_reparse.py (+0/-2)
To merge this branch: bzr merge lp:~eridanus-developers/eridanus/grant-install-avatar
Reviewer Review Type Date Requested Status
Jonathan Jacobs Approve
Review via email: mp+24965@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Jacobs (jjacobs) wrote :

Looks good to merge. One thing, if you don't grant a user any plugins they still won't be able to auth, I guess the solution here is to add an axiomatic command to create users to Eridanus (instead of using the userbase one.) At the moment, there is no real point in having a user without any plugins granted, so I wouldn't say this is important to fix, but I've filed bug #578222 anyway.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'axiom/plugins/eridanuscmd.py'
2--- axiom/plugins/eridanuscmd.py 2010-01-02 07:50:32 +0000
3+++ axiom/plugins/eridanuscmd.py 2010-05-09 21:50:42 +0000
4@@ -5,7 +5,9 @@
5 from axiom.attributes import AND
6
7 from eridanus import plugin
8+from eridanus.ieridanus import IIRCAvatar
9 from eridanus.bot import IRCBotService, IRCBotFactoryFactory, IRCBotConfig
10+from eridanus.avatar import AuthenticatedAvatar
11
12
13
14@@ -170,6 +172,9 @@
15 loginAccount = loginSystem.accountByAddress(self['username'], self['domain'])
16 assert loginAccount is not None, 'No such user'
17 userStore = loginAccount.avatars.open()
18+ avatar = IIRCAvatar(userStore, None)
19+ if avatar is None:
20+ userStore.powerUp(AuthenticatedAvatar(store=userStore))
21 plugin.installPlugin(userStore, self['pluginName'])
22
23
24
25=== modified file 'bin/fixinitialcomment.py'
26--- bin/fixinitialcomment.py 2008-03-24 00:30:21 +0000
27+++ bin/fixinitialcomment.py 2010-05-09 21:50:42 +0000
28@@ -2,7 +2,7 @@
29
30 from axiom.store import Store
31
32-from eridanus.entry import Entry, Comment
33+from eridanus.entry import Entry
34
35
36 db = Store(sys.argv[1])
37
38=== modified file 'bin/killbrokenmanagers.py'
39--- bin/killbrokenmanagers.py 2008-03-24 00:30:21 +0000
40+++ bin/killbrokenmanagers.py 2010-05-09 21:50:42 +0000
41@@ -1,7 +1,6 @@
42 import sys
43
44 from axiom.store import Store
45-from axiom.dependency import uninstallFrom
46
47 from eridanus.bot import IRCBotService
48
49
50=== modified file 'bin/setconfigname.py'
51--- bin/setconfigname.py 2008-03-24 00:30:21 +0000
52+++ bin/setconfigname.py 2010-05-09 21:50:42 +0000
53@@ -1,7 +1,6 @@
54 import sys
55
56 from axiom.store import Store
57-from axiom.dependency import uninstallFrom
58
59 from eridanus.bot import IRCBotService
60
61
62=== modified file 'eridanus/avatar.py'
63--- eridanus/avatar.py 2008-10-17 21:06:10 +0000
64+++ eridanus/avatar.py 2010-05-09 21:50:42 +0000
65@@ -51,6 +51,7 @@
66 """
67 typeName = 'eridanus_avatar_authenticatedavatar'
68 schemaVersion = 1
69+ powerupInterfaces = [IIRCAvatar]
70
71 dummy = integer()
72
73
74=== modified file 'eridanus/bot.py'
75--- eridanus/bot.py 2010-01-02 07:59:40 +0000
76+++ eridanus/bot.py 2010-05-09 21:50:42 +0000
77@@ -285,7 +285,7 @@
78
79
80 def directedPublicMessage(self, source, message):
81- d = maybeDeferred(self.command, source, message
82+ maybeDeferred(self.command, source, message
83 ).addErrback(self.mentionFailure, source)
84
85 privateMessage = directedPublicMessage
86@@ -293,7 +293,7 @@
87
88 def publicMessage(self, source, message):
89 for obs in plugin.getAmbientEventObservers(self.appStore):
90- d = maybeDeferred(obs.publicMessageReceived, source, message
91+ maybeDeferred(obs.publicMessageReceived, source, message
92 ).addErrback(self.mentionFailure, source)
93
94
95
96=== modified file 'eridanus/iriparse.py'
97--- eridanus/iriparse.py 2009-04-12 09:02:01 +0000
98+++ eridanus/iriparse.py 2010-05-09 21:50:42 +0000
99@@ -1,4 +1,6 @@
100 import string
101+# suppress pyflakes warning, as this is used by the PyMeta grammar
102+string
103
104 from pymeta.grammar import OMeta
105 from pymeta.runtime import ParseError
106
107=== modified file 'eridanus/plugin.py'
108--- eridanus/plugin.py 2010-01-02 09:40:10 +0000
109+++ eridanus/plugin.py 2010-05-09 21:50:42 +0000
110@@ -261,7 +261,7 @@
111 will accept
112 @rtype: C{(min, max)}
113 """
114- minargs, maxargs = arglimits = getattr(self.method, 'arglimits', (None, None))
115+ minargs, maxargs = getattr(self.method, 'arglimits', (None, None))
116 return getCommandArgLimits(self.method, minargs, maxargs)
117
118
119
120=== modified file 'eridanus/reparse.py'
121--- eridanus/reparse.py 2009-01-23 15:12:36 +0000
122+++ eridanus/reparse.py 2010-05-09 21:50:42 +0000
123@@ -2,6 +2,8 @@
124 Parse a regular expression into it's parts.
125 """
126 import re, string
127+# suppress pyflakes warning, as this is used by the PyMeta grammar
128+string
129
130 from pymeta.grammar import OMeta
131 from pymeta.runtime import ParseError
132
133=== modified file 'eridanus/test/plugin_broken.py'
134--- eridanus/test/plugin_broken.py 2010-01-02 09:40:10 +0000
135+++ eridanus/test/plugin_broken.py 2010-05-09 21:50:42 +0000
136@@ -17,3 +17,4 @@
137
138 # Here we import a mythical module to generate an ImportError.
139 import gyre_and_gimble_in_the_wabe
140+gyre_and_gimble_in_the_wabe
141
142=== modified file 'eridanus/test/test_plugin.py'
143--- eridanus/test/test_plugin.py 2010-01-02 09:40:10 +0000
144+++ eridanus/test/test_plugin.py 2010-05-09 21:50:42 +0000
145@@ -5,6 +5,11 @@
146 from eridanus.ieridanus import IEridanusPlugin, IEridanusBrokenPlugin
147
148
149+# Make pyflakes happy
150+UselessPlugin = None
151+SadPlugin = None
152+
153+
154 class TestSafePluginImport(unittest.TestCase):
155 """
156 Tests for the broken plugin system.
157
158=== modified file 'eridanus/test/test_reparse.py'
159--- eridanus/test/test_reparse.py 2008-11-28 15:16:35 +0000
160+++ eridanus/test/test_reparse.py 2010-05-09 21:50:42 +0000
161@@ -1,5 +1,3 @@
162-from datetime import timedelta
163-
164 from twisted.trial import unittest
165
166 from eridanus import errors, reparse

Subscribers

People subscribed via source and target branches