Merge lp:~bradwhittington/ibid/translation into lp:~ibid-core/ibid/old-trunk-pack-0.92
- translation
- Merge into old-trunk-pack-0.92
Status: | Rejected |
---|---|
Rejected by: | Stefano Rivera |
Proposed branch: | lp:~bradwhittington/ibid/translation |
Merge into: | lp:~ibid-core/ibid/old-trunk-pack-0.92 |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~bradwhittington/ibid/translation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefano Rivera | Disapprove | ||
Jonathan Hitchcock | Abstain | ||
Michael Gorven | Needs Fixing | ||
Review via email: mp+3962@code.launchpad.net |
Commit message
Description of the change
Brad Whittington (bradwhittington) wrote : | # |
Michael Gorven (mgorven) wrote : | # |
I think we decided to use dicts so that translations can reorder the
arguments.
review needs_fixing
Jonathan Hitchcock (vhata) wrote : | # |
I don't understand the issues involved with this stuff enough to vote properly.
I will say that this seems to be a fairly deep architectural change that doesn't seem necessary right now?
Russell Cloran (russell) wrote : | # |
It'd be good if you could dig up the argument/case for not mixing args and
kwargs -- I have something like that at the back of my mind too, but can't
for the life of me remember where I would've seen it.
I think that kwargs would be much nicer than passing in a dict.
Stefano Rivera (stefanor) wrote : | # |
The only concern with the kwargs route is that we can't add any other parameters to addresponse().
Russell Cloran (russell) wrote : | # |
Fair argument which I'd be happy to accept ;)
Brad Whittington (bradwhittington) wrote : | # |
Will refactor to dict approach tomorrow, seems fine enough to me.
On 3/1/09, Russell Cloran <email address hidden> wrote:
> Fair argument which I'd be happy to accept ;)
>
> --
> https:/
> You are subscribed to branch lp:~bradwhittington/ibid/translation.
>
--
Sent from my mobile device
Brad Whittington
--
The opinions reflected in this communication do not necessarily
reflect the opinions of Google.
Stefano Rivera (stefanor) wrote : | # |
"Will refactor to dict approach tomorrow, seems fine enough to me.
Be advised that I have a big pile of waiting merges on plugin contents.
The most problematic will be:
https:/
I'll attempt to prod Vhata and cocooncrash into skipping work and reading them.
Stefano Rivera (stefanor) wrote : | # |
"Be advised that I have a big pile of waiting merges on plugin contents."
Coast is clear again
Stefano Rivera (stefanor) wrote : | # |
Sorry, I redid this myself :P
Preview Diff
1 | === modified file 'ibid/event.py' | |||
2 | --- ibid/event.py 2009-02-23 20:29:44 +0000 | |||
3 | +++ ibid/event.py 2009-02-26 09:53:00 +0000 | |||
4 | @@ -14,8 +14,12 @@ | |||
5 | 14 | def __setattr__(self, name, value): | 14 | def __setattr__(self, name, value): |
6 | 15 | self[name] = value | 15 | self[name] = value |
7 | 16 | 16 | ||
10 | 17 | def addresponse(self, response, processed=True): | 17 | def addresponse(self, response, processed=True, *args): |
11 | 18 | self.responses.append(response) | 18 | try: |
12 | 19 | processed_response = response % args | ||
13 | 20 | except TypeError: | ||
14 | 21 | processed_response = response | ||
15 | 22 | self.responses.append(processed_response) | ||
16 | 19 | 23 | ||
17 | 20 | if processed: | 24 | if processed: |
18 | 21 | self.processed = True | 25 | self.processed = True |
19 | 22 | 26 | ||
20 | === modified file 'ibid/plugins/admin.py' | |||
21 | --- ibid/plugins/admin.py 2009-02-13 21:19:45 +0000 | |||
22 | +++ ibid/plugins/admin.py 2009-02-26 09:53:00 +0000 | |||
23 | @@ -36,7 +36,7 @@ | |||
24 | 36 | else: | 36 | else: |
25 | 37 | result = getattr(ibid.reloader, 'reload_%s' % module)() | 37 | result = getattr(ibid.reloader, 'reload_%s' % module)() |
26 | 38 | 38 | ||
28 | 39 | event.addresponse(result and u'%s reloaded' % module or u"Couldn't reload %s" % module) | 39 | event.addresponse(result and u'%s reloaded' or u"Couldn't reload %s", module) |
29 | 40 | 40 | ||
30 | 41 | class LoadModules(Processor): | 41 | class LoadModules(Processor): |
31 | 42 | """(load|unload|reload) <plugin|processor>""" | 42 | """(load|unload|reload) <plugin|processor>""" |
32 | @@ -49,13 +49,13 @@ | |||
33 | 49 | def load(self, event, plugin): | 49 | def load(self, event, plugin): |
34 | 50 | result = ibid.reloader.unload_processor(plugin) | 50 | result = ibid.reloader.unload_processor(plugin) |
35 | 51 | result = ibid.reloader.load_processor(plugin) | 51 | result = ibid.reloader.load_processor(plugin) |
37 | 52 | event.addresponse(result and u'%s reloaded' % plugin or u"Couldn't reload %s" % plugin) | 52 | event.addresponse(result and u'%s reloaded' or u"Couldn't reload %s", plugin) |
38 | 53 | 53 | ||
39 | 54 | @match(r'^unload\s+(\S+)$') | 54 | @match(r'^unload\s+(\S+)$') |
40 | 55 | @authorise | 55 | @authorise |
41 | 56 | def unload(self, event, plugin): | 56 | def unload(self, event, plugin): |
42 | 57 | result = ibid.reloader.unload_processor(plugin) | 57 | result = ibid.reloader.unload_processor(plugin) |
44 | 58 | event.addresponse(result and u'%s unloaded' % plugin or u"Couldn't unload %s" % plugin) | 58 | event.addresponse(result and u'%s unloaded' or u"Couldn't unload %s", plugin) |
45 | 59 | 59 | ||
46 | 60 | help['die'] = u'Terminates the bot' | 60 | help['die'] = u'Terminates the bot' |
47 | 61 | class Die(Processor): | 61 | class Die(Processor): |
48 | 62 | 62 | ||
49 | === modified file 'ibid/plugins/auth.py' | |||
50 | --- ibid/plugins/auth.py 2009-02-22 15:30:46 +0000 | |||
51 | +++ ibid/plugins/auth.py 2009-02-26 09:53:00 +0000 | |||
52 | @@ -36,7 +36,7 @@ | |||
53 | 36 | return | 36 | return |
54 | 37 | account = session.query(Account).filter_by(username=user).first() | 37 | account = session.query(Account).filter_by(username=user).first() |
55 | 38 | if not account: | 38 | if not account: |
57 | 39 | event.addresponse(u"I don't know who %s is" % user) | 39 | event.addresponse(u"I don't know who %s is", user) |
58 | 40 | session.close() | 40 | session.close() |
59 | 41 | return | 41 | return |
60 | 42 | 42 | ||
61 | @@ -71,7 +71,7 @@ | |||
62 | 71 | session = ibid.databases.ibid() | 71 | session = ibid.databases.ibid() |
63 | 72 | account = session.query(Account).filter_by(username=username).first() | 72 | account = session.query(Account).filter_by(username=username).first() |
64 | 73 | if not account: | 73 | if not account: |
66 | 74 | event.addresponse(u"I don't know who %s is" % username) | 74 | event.addresponse(u"I don't know who %s is", username) |
67 | 75 | session.close() | 75 | session.close() |
68 | 76 | return | 76 | return |
69 | 77 | 77 | ||
70 | @@ -80,7 +80,7 @@ | |||
71 | 80 | if permission: | 80 | if permission: |
72 | 81 | session.delete(permission) | 81 | session.delete(permission) |
73 | 82 | else: | 82 | else: |
75 | 83 | event.addresponse(u"%s doesn't have that permission anyway" % username) | 83 | event.addresponse(u"%s doesn't have that permission anyway", username) |
76 | 84 | return | 84 | return |
77 | 85 | 85 | ||
78 | 86 | else: | 86 | else: |
79 | @@ -95,7 +95,7 @@ | |||
80 | 95 | value = 'yes' | 95 | value = 'yes' |
81 | 96 | 96 | ||
82 | 97 | if permission.value == value: | 97 | if permission.value == value: |
84 | 98 | event.addresponse(u"%s permission for %s is already %s" % (name, username, value)) | 98 | event.addresponse(u"%s permission for %s is already %s", name, username, value) |
85 | 99 | return | 99 | return |
86 | 100 | 100 | ||
87 | 101 | permission.value = value | 101 | permission.value = value |
88 | @@ -120,7 +120,7 @@ | |||
89 | 120 | return | 120 | return |
90 | 121 | account = session.query(Account).filter_by(username=username).first() | 121 | account = session.query(Account).filter_by(username=username).first() |
91 | 122 | if not account: | 122 | if not account: |
93 | 123 | event.addresponse(u"I don't know who %s is" % username) | 123 | event.addresponse(u"I don't know who %s is", username) |
94 | 124 | return | 124 | return |
95 | 125 | 125 | ||
96 | 126 | event.addresponse(', '.join(['%s%s' % (permission_values[perm.value], perm.name) for perm in account.permissions])) | 126 | event.addresponse(', '.join(['%s%s' % (permission_values[perm.value], perm.name) for perm in account.permissions])) |
97 | 127 | 127 | ||
98 | === modified file 'ibid/plugins/basic.py' | |||
99 | --- ibid/plugins/basic.py 2009-02-13 21:19:45 +0000 | |||
100 | +++ ibid/plugins/basic.py 2009-02-26 09:53:00 +0000 | |||
101 | @@ -65,7 +65,7 @@ | |||
102 | 65 | 65 | ||
103 | 66 | @match(r'^(?:choose|choice|pick)\s+(.+)$') | 66 | @match(r'^(?:choose|choice|pick)\s+(.+)$') |
104 | 67 | def choose(self, event, choices): | 67 | def choose(self, event, choices): |
106 | 68 | event.addresponse(u'I choose %s' % choice(choose_re.split(choices))) | 68 | event.addresponse(u'I choose %s',choice(choose_re.split(choices))) |
107 | 69 | 69 | ||
108 | 70 | class UnicodeWarning(Processor): | 70 | class UnicodeWarning(Processor): |
109 | 71 | 71 | ||
110 | 72 | 72 | ||
111 | === modified file 'ibid/plugins/crypto.py' | |||
112 | --- ibid/plugins/crypto.py 2009-01-24 12:39:04 +0000 | |||
113 | +++ ibid/plugins/crypto.py 2009-02-26 09:53:00 +0000 | |||
114 | @@ -13,7 +13,7 @@ | |||
115 | 13 | 13 | ||
116 | 14 | @match(r'^(md5|sha1|sha224|sha256|sha384|sha512)\s+(.+?)$') | 14 | @match(r'^(md5|sha1|sha224|sha256|sha384|sha512)\s+(.+?)$') |
117 | 15 | def hash(self, event, hash, string): | 15 | def hash(self, event, hash, string): |
119 | 16 | event.addresponse(eval('hashlib.%s' % hash.lower())(string).hexdigest()) | 16 | event.addresponse(eval('hashlib.%s', hash.lower())(string).hexdigest()) |
120 | 17 | 17 | ||
121 | 18 | @match(r'^crypt\s+(.+)\s+(\S+)$') | 18 | @match(r'^crypt\s+(.+)\s+(\S+)$') |
122 | 19 | def handle_crypt(self, event, string, salt): | 19 | def handle_crypt(self, event, string, salt): |
123 | 20 | 20 | ||
124 | === modified file 'ibid/plugins/factoid.py' | |||
125 | --- ibid/plugins/factoid.py 2009-02-23 20:29:44 +0000 | |||
126 | +++ ibid/plugins/factoid.py 2009-02-26 09:53:00 +0000 | |||
127 | @@ -149,7 +149,7 @@ | |||
128 | 149 | session.close() | 149 | session.close() |
129 | 150 | event.addresponse(True) | 150 | event.addresponse(True) |
130 | 151 | else: | 151 | else: |
132 | 152 | event.addresponse(u"I didn't know about %s anyway" % name) | 152 | event.addresponse(u"I didn't know about %s anyway", name) |
133 | 153 | 153 | ||
134 | 154 | @match(r'^(.+)\s+is\s+the\s+same\s+as\s+(.+)$') | 154 | @match(r'^(.+)\s+is\s+the\s+same\s+as\s+(.+)$') |
135 | 155 | @authorise | 155 | @authorise |
136 | @@ -169,7 +169,7 @@ | |||
137 | 169 | event.addresponse(True) | 169 | event.addresponse(True) |
138 | 170 | log.info(u"Added name '%s' to factoid %s by %s/%s (%s)", name.name, factoid.id, event.account, event.identity, event.sender['connection']) | 170 | log.info(u"Added name '%s' to factoid %s by %s/%s (%s)", name.name, factoid.id, event.account, event.identity, event.sender['connection']) |
139 | 171 | else: | 171 | else: |
141 | 172 | event.addresponse(u"I don't know about %s" % name) | 172 | event.addresponse(u"I don't know about %s", name) |
142 | 173 | 173 | ||
143 | 174 | class Search(Processor): | 174 | class Search(Processor): |
144 | 175 | """(search|scan) for <pattern>""" | 175 | """(search|scan) for <pattern>""" |
145 | @@ -292,7 +292,7 @@ | |||
146 | 292 | session.delete(fvalue) | 292 | session.delete(fvalue) |
147 | 293 | session.flush() | 293 | session.flush() |
148 | 294 | elif not addition: | 294 | elif not addition: |
150 | 295 | event.addresponse(u"I already know stuff about %s" % name) | 295 | event.addresponse(u"I already know stuff about %s", name) |
151 | 296 | return | 296 | return |
152 | 297 | else: | 297 | else: |
153 | 298 | factoid = Factoid() | 298 | factoid = Factoid() |
154 | 299 | 299 | ||
155 | === modified file 'ibid/plugins/feeds.py' | |||
156 | --- ibid/plugins/feeds.py 2009-02-23 20:29:44 +0000 | |||
157 | +++ ibid/plugins/feeds.py 2009-02-26 09:53:00 +0000 | |||
158 | @@ -58,7 +58,7 @@ | |||
159 | 58 | feed = session.query(Feed).filter(func.lower(Feed.name)==name.lower()).first() | 58 | feed = session.query(Feed).filter(func.lower(Feed.name)==name.lower()).first() |
160 | 59 | 59 | ||
161 | 60 | if feed: | 60 | if feed: |
163 | 61 | event.addresponse(u"I already have the %s feed" % name) | 61 | event.addresponse(u"I already have the %s feed", name) |
164 | 62 | else: | 62 | else: |
165 | 63 | feed = Feed(unicode(name), unicode(url), event.identity) | 63 | feed = Feed(unicode(name), unicode(url), event.identity) |
166 | 64 | 64 | ||
167 | @@ -68,7 +68,7 @@ | |||
168 | 68 | event.addresponse(True) | 68 | event.addresponse(True) |
169 | 69 | log.info(u"Added feed '%s' by %s/%s (%s): %s (Found %s entries)", name, event.account, event.identity, event.sender['connection'], url, len(feed.entries)) | 69 | log.info(u"Added feed '%s' by %s/%s (%s): %s (Found %s entries)", name, event.account, event.identity, event.sender['connection'], url, len(feed.entries)) |
170 | 70 | else: | 70 | else: |
172 | 71 | event.addresponse(u"Sorry, I could not add the %s feed. %s is not a valid feed" % (name,url)) | 71 | event.addresponse(u"Sorry, I could not add the %s feed. %s is not a valid feed", name,url) |
173 | 72 | 72 | ||
174 | 73 | session.close() | 73 | session.close() |
175 | 74 | 74 | ||
176 | @@ -88,7 +88,7 @@ | |||
177 | 88 | feed = session.query(Feed).filter(func.lower(Feed.name)==name.lower()).first() | 88 | feed = session.query(Feed).filter(func.lower(Feed.name)==name.lower()).first() |
178 | 89 | 89 | ||
179 | 90 | if not feed: | 90 | if not feed: |
181 | 91 | event.addresponse(u"I don't have the %s feed anyway" % name) | 91 | event.addresponse(u"I don't have the %s feed anyway", name) |
182 | 92 | else: | 92 | else: |
183 | 93 | session.delete(feed) | 93 | session.delete(feed) |
184 | 94 | log.info(u"Deleted feed '%s' by %s/%s (%s): %s", name, event.account, event.identity, event.sender['connection'], feed.url) | 94 | log.info(u"Deleted feed '%s' by %s/%s (%s): %s", name, event.account, event.identity, event.sender['connection'], feed.url) |
185 | @@ -112,7 +112,7 @@ | |||
186 | 112 | session.close() | 112 | session.close() |
187 | 113 | 113 | ||
188 | 114 | if not feed: | 114 | if not feed: |
190 | 115 | event.addresponse(u"I don't know about the %s feed" % name) | 115 | event.addresponse(u"I don't know about the %s feed", name) |
191 | 116 | return | 116 | return |
192 | 117 | 117 | ||
193 | 118 | feed.update() | 118 | feed.update() |
194 | @@ -129,7 +129,7 @@ | |||
195 | 129 | session.close() | 129 | session.close() |
196 | 130 | 130 | ||
197 | 131 | if not feed: | 131 | if not feed: |
199 | 132 | event.addresponse(u"I don't know about the %s feed" % name) | 132 | event.addresponse(u"I don't know about the %s feed", name) |
200 | 133 | return | 133 | return |
201 | 134 | 134 | ||
202 | 135 | feed.update() | 135 | feed.update() |
203 | @@ -163,6 +163,6 @@ | |||
204 | 163 | else: | 163 | else: |
205 | 164 | summary = article.content[0].value | 164 | summary = article.content[0].value |
206 | 165 | 165 | ||
208 | 166 | event.addresponse(u'"%s" %s : %s' % (html2text_file(article.title, None).strip(), article.link, summary)) | 166 | event.addresponse(u'"%s" %s : %s', html2text_file(article.title, None).strip(), article.link, summary) |
209 | 167 | 167 | ||
210 | 168 | # vi: set et sta sw=4 ts=4: | 168 | # vi: set et sta sw=4 ts=4: |
211 | 169 | 169 | ||
212 | === modified file 'ibid/plugins/google.py' | |||
213 | --- ibid/plugins/google.py 2009-02-12 20:58:39 +0000 | |||
214 | +++ ibid/plugins/google.py 2009-02-26 09:53:00 +0000 | |||
215 | @@ -101,6 +101,6 @@ | |||
216 | 101 | def compare(self, event, term1, term2): | 101 | def compare(self, event, term1, term2): |
217 | 102 | count1 = self.results(term1) | 102 | count1 = self.results(term1) |
218 | 103 | count2 = self.results(term2) | 103 | count2 = self.results(term2) |
220 | 104 | event.addresponse(u'%s wins with %s hits, %s had %s hits' % (count1 > count2 and term1 or term2, count1 > count2 and count1 or count2, count1 > count2 and term2 or term1, count1 > count2 and count2 or count1)) | 104 | event.addresponse(u'%s wins with %s hits, %s had %s hits', count1 > count2 and term1 or term2, count1 > count2 and count1 or count2, count1 > count2 and term2 or term1, count1 > count2 and count2 or count1) |
221 | 105 | 105 | ||
222 | 106 | # vi: set et sta sw=4 ts=4: | 106 | # vi: set et sta sw=4 ts=4: |
223 | 107 | 107 | ||
224 | === modified file 'ibid/plugins/help.py' | |||
225 | --- ibid/plugins/help.py 2009-02-21 12:31:38 +0000 | |||
226 | +++ ibid/plugins/help.py 2009-02-26 09:53:00 +0000 | |||
227 | @@ -36,7 +36,7 @@ | |||
228 | 36 | event.addresponse(module.help[feature]) | 36 | event.addresponse(module.help[feature]) |
229 | 37 | return | 37 | return |
230 | 38 | 38 | ||
232 | 39 | event.addresponse(u"I can't help you with %s" % feature) | 39 | event.addresponse(u"I can't help you with %s", feature) |
233 | 40 | 40 | ||
234 | 41 | @match(r'^(?:usage|how\s+do\s+I\s+use)\s+(.+)$') | 41 | @match(r'^(?:usage|how\s+do\s+I\s+use)\s+(.+)$') |
235 | 42 | def usage(self, event, feature): | 42 | def usage(self, event, feature): |
236 | @@ -46,7 +46,7 @@ | |||
237 | 46 | for name, klass in inspect.getmembers(processor, inspect.isclass): | 46 | for name, klass in inspect.getmembers(processor, inspect.isclass): |
238 | 47 | if hasattr(klass, 'feature') and klass.feature == feature and klass.__doc__: | 47 | if hasattr(klass, 'feature') and klass.feature == feature and klass.__doc__: |
239 | 48 | for line in klass.__doc__.splitlines(): | 48 | for line in klass.__doc__.splitlines(): |
241 | 49 | event.addresponse('Usage: %s' % line.strip()) | 49 | event.addresponse('Usage: %s', line.strip()) |
242 | 50 | 50 | ||
243 | 51 | if not event.responses: | 51 | if not event.responses: |
245 | 52 | event.addresponse(u"I don't know how to use %s either" % feature) | 52 | event.addresponse(u"I don't know how to use %s either", feature) |
246 | 53 | 53 | ||
247 | === modified file 'ibid/plugins/identity.py' | |||
248 | --- ibid/plugins/identity.py 2009-02-23 20:43:40 +0000 | |||
249 | +++ ibid/plugins/identity.py 2009-02-26 09:53:00 +0000 | |||
250 | @@ -29,12 +29,12 @@ | |||
251 | 29 | admin = True | 29 | admin = True |
252 | 30 | else: | 30 | else: |
253 | 31 | account = session.query(Account).filter_by(id=event.account).first() | 31 | account = session.query(Account).filter_by(id=event.account).first() |
255 | 32 | event.addresponse(u'You already have an account called "%s".' % account.username) | 32 | event.addresponse(u'You already have an account called "%s".',account.username) |
256 | 33 | return | 33 | return |
257 | 34 | 34 | ||
258 | 35 | account = session.query(Account).filter_by(username=username).first() | 35 | account = session.query(Account).filter_by(username=username).first() |
259 | 36 | if account: | 36 | if account: |
261 | 37 | event.addresponse(u'There is already an account called "%s". Please choose a different name.' % account.username) | 37 | event.addresponse(u'There is already an account called "%s". Please choose a different name.', account.username) |
262 | 38 | return | 38 | return |
263 | 39 | 39 | ||
264 | 40 | account = Account(username) | 40 | account = Account(username) |
265 | @@ -78,7 +78,7 @@ | |||
266 | 78 | username = event.sender['id'] | 78 | username = event.sender['id'] |
267 | 79 | account = session.query(Account).filter_by(username=username).first() | 79 | account = session.query(Account).filter_by(username=username).first() |
268 | 80 | if account: | 80 | if account: |
270 | 81 | event.addresponse(u"I tried to create the account %s for you, but it already exists. Please use 'create account <name>'." % username) | 81 | event.addresponse(u"I tried to create the account %s for you, but it already exists. Please use 'create account <name>'.", username) |
271 | 82 | return | 82 | return |
272 | 83 | account = Account(username) | 83 | account = Account(username) |
273 | 84 | session.save_or_update(account) | 84 | session.save_or_update(account) |
274 | @@ -88,7 +88,7 @@ | |||
275 | 88 | session.save_or_update(currentidentity) | 88 | session.save_or_update(currentidentity) |
276 | 89 | session.flush() | 89 | session.flush() |
277 | 90 | identify_cache.clear() | 90 | identify_cache.clear() |
279 | 91 | event.addresponse(u"I've created the account %s for you" % username) | 91 | event.addresponse(u"I've created the account %s for you", username) |
280 | 92 | log.info(u"Created account %s (%s) by %s/%s (%s)", account.id, account.username, event.account, event.identity, event.sender['connection']) | 92 | log.info(u"Created account %s (%s) by %s/%s (%s)", account.id, account.username, event.account, event.identity, event.sender['connection']) |
281 | 93 | log.info(u"Attached identity %s (%s on %s) to account %s (%s)", currentidentity.id, currentidentity.identity, currentidentity.source, account.id, account.username) | 93 | log.info(u"Attached identity %s (%s on %s) to account %s (%s)", currentidentity.id, currentidentity.identity, currentidentity.source, account.id, account.username) |
282 | 94 | 94 | ||
283 | @@ -98,16 +98,16 @@ | |||
284 | 98 | admin = True | 98 | admin = True |
285 | 99 | account = session.query(Account).filter_by(username=username).first() | 99 | account = session.query(Account).filter_by(username=username).first() |
286 | 100 | if not account: | 100 | if not account: |
288 | 101 | event.addresponse(u"I don't know who %s is" % username) | 101 | event.addresponse(u"I don't know who %s is", username) |
289 | 102 | return | 102 | return |
290 | 103 | 103 | ||
291 | 104 | ident = session.query(Identity).filter(func.lower(Identity.identity)==identity.lower()).filter(func.lower(Identity.source)==source.lower()).first() | 104 | ident = session.query(Identity).filter(func.lower(Identity.identity)==identity.lower()).filter(func.lower(Identity.source)==source.lower()).first() |
292 | 105 | if ident and ident.account: | 105 | if ident and ident.account: |
294 | 106 | event.addresponse(u'This identity is already attached to account %s' % ident.account.username) | 106 | event.addresponse(u'This identity is already attached to account %s', ident.account.username) |
295 | 107 | return | 107 | return |
296 | 108 | 108 | ||
297 | 109 | if source.lower() not in ibid.sources: | 109 | if source.lower() not in ibid.sources: |
299 | 110 | event.addresponse(u"I am not connected to %s" % source) | 110 | event.addresponse(u"I am not connected to %s", source) |
300 | 111 | else: | 111 | else: |
301 | 112 | source = ibid.sources[source.lower()].name | 112 | source = ibid.sources[source.lower()].name |
302 | 113 | 113 | ||
303 | @@ -136,7 +136,7 @@ | |||
304 | 136 | session = ibid.databases.ibid() | 136 | session = ibid.databases.ibid() |
305 | 137 | (account_id, user, source) = self.tokens[token] | 137 | (account_id, user, source) = self.tokens[token] |
306 | 138 | if event.source.lower() != source.lower() or event.sender['id'].lower() != user.lower(): | 138 | if event.source.lower() != source.lower() or event.sender['id'].lower() != user.lower(): |
308 | 139 | event.addresponse(u'You need to send me this token from %s on %s' % (user, source)) | 139 | event.addresponse(u'You need to send me this token from %s on %s', user, source) |
309 | 140 | return | 140 | return |
310 | 141 | 141 | ||
311 | 142 | identity = session.query(Identity).filter(func.lower(Identity.identity)==user.lower()).filter(func.lower(Identity.source)==source.lower()).first() | 142 | identity = session.query(Identity).filter(func.lower(Identity.identity)==user.lower()).filter(func.lower(Identity.source)==source.lower()).first() |
312 | @@ -163,7 +163,7 @@ | |||
313 | 163 | return | 163 | return |
314 | 164 | account = session.query(Account).filter_by(username=username).first() | 164 | account = session.query(Account).filter_by(username=username).first() |
315 | 165 | if not account: | 165 | if not account: |
317 | 166 | event.addresponse(u"I don't know who %s is" % username) | 166 | event.addresponse(u"I don't know who %s is", username) |
318 | 167 | return | 167 | return |
319 | 168 | 168 | ||
320 | 169 | identity = session.query(Identity).filter_by(account_id=account.id).filter(func.lower(Identity.identity)==user.lower()).filter(func.lower(Identity.source)==source.lower()).first() | 169 | identity = session.query(Identity).filter_by(account_id=account.id).filter(func.lower(Identity.identity)==user.lower()).filter(func.lower(Identity.source)==source.lower()).first() |
321 | @@ -194,7 +194,7 @@ | |||
322 | 194 | return | 194 | return |
323 | 195 | account = session.query(Account).filter_by(id=event.account).first() | 195 | account = session.query(Account).filter_by(id=event.account).first() |
324 | 196 | if not account: | 196 | if not account: |
326 | 197 | event.addresponse(u"%s doesn't exist. Please use 'add account' first" % username) | 197 | event.addresponse(u"%s doesn't exist. Please use 'add account' first", username) |
327 | 198 | return | 198 | return |
328 | 199 | 199 | ||
329 | 200 | else: | 200 | else: |
330 | @@ -202,7 +202,7 @@ | |||
331 | 202 | return | 202 | return |
332 | 203 | account = session.query(Account).filter_by(username=username).first() | 203 | account = session.query(Account).filter_by(username=username).first() |
333 | 204 | if not account: | 204 | if not account: |
335 | 205 | event.addresponse(u"I don't know who %s is" % username) | 205 | event.addresponse(u"I don't know who %s is", username) |
336 | 206 | return | 206 | return |
337 | 207 | 207 | ||
338 | 208 | account.attributes.append(Attribute(name, value)) | 208 | account.attributes.append(Attribute(name, value)) |
339 | @@ -220,17 +220,17 @@ | |||
340 | 220 | if username.upper() == 'I': | 220 | if username.upper() == 'I': |
341 | 221 | if not event.account: | 221 | if not event.account: |
342 | 222 | identity = session.query(Identity).get(event.identity) | 222 | identity = session.query(Identity).get(event.identity) |
344 | 223 | event.addresponse(u"%s on %s" % (identity.identity, identity.source)) | 223 | event.addresponse(u"%s on %s", identity.identity, identity.source) |
345 | 224 | return | 224 | return |
346 | 225 | account = session.query(Account).get(event.account) | 225 | account = session.query(Account).get(event.account) |
347 | 226 | 226 | ||
348 | 227 | else: | 227 | else: |
349 | 228 | account = session.query(Account).filter_by(username=username).first() | 228 | account = session.query(Account).filter_by(username=username).first() |
350 | 229 | if not account: | 229 | if not account: |
352 | 230 | event.addresponse(u"I don't know who %s is" % username) | 230 | event.addresponse(u"I don't know who %s is", username) |
353 | 231 | return | 231 | return |
354 | 232 | 232 | ||
356 | 233 | event.addresponse(u'%s is %s' % (account.username, ', '.join('%s on %s' % (identity.identity, identity.source) for identity in account.identities))) | 233 | event.addresponse(u'%s is %s', account.username, ', '.join('%s on %s' % (identity.identity, identity.source) for identity in account.identities)) |
357 | 234 | session.close() | 234 | session.close() |
358 | 235 | 235 | ||
359 | 236 | class Identify(Processor): | 236 | class Identify(Processor): |
360 | 237 | 237 | ||
361 | === modified file 'ibid/plugins/imdb.py' | |||
362 | --- ibid/plugins/imdb.py 2009-02-23 14:59:37 +0000 | |||
363 | +++ ibid/plugins/imdb.py 2009-02-26 09:53:00 +0000 | |||
364 | @@ -48,7 +48,7 @@ | |||
365 | 48 | self.imdb.update(result) | 48 | self.imdb.update(result) |
366 | 49 | 49 | ||
367 | 50 | except IMDbDataAccessError, e: | 50 | except IMDbDataAccessError, e: |
369 | 51 | event.addresponse(u"IMDb doesn't like me today. It said '%s'" % e[0]["errmsg"]) | 51 | event.addresponse(u"IMDb doesn't like me today. It said '%s'", e[0]["errmsg"]) |
370 | 52 | raise | 52 | raise |
371 | 53 | 53 | ||
372 | 54 | except IMDbError, e: | 54 | except IMDbError, e: |
373 | @@ -56,7 +56,7 @@ | |||
374 | 56 | raise | 56 | raise |
375 | 57 | 57 | ||
376 | 58 | if result is not None: | 58 | if result is not None: |
378 | 59 | event.addresponse(u"Found " + getattr(self, "display_" + search_type)(result)) | 59 | event.addresponse(u"Found %s", getattr(self, "display_" + search_type)(result)) |
379 | 60 | return | 60 | return |
380 | 61 | 61 | ||
381 | 62 | if len(results) == 0: | 62 | if len(results) == 0: |
382 | @@ -66,7 +66,7 @@ | |||
383 | 66 | results = enumerate(results) | 66 | results = enumerate(results) |
384 | 67 | results = [u"%i: %s" % (x[0] + 1, x[1]) for x in results] | 67 | results = [u"%i: %s" % (x[0] + 1, x[1]) for x in results] |
385 | 68 | more = (u"", u">")[len(results) == 20] | 68 | more = (u"", u">")[len(results) == 20] |
387 | 69 | event.addresponse(u"Found %s%i matches: %s" % (more, len(results), u", ".join(results))) | 69 | event.addresponse(u"Found %s%i matches: %s", more, len(results), u", ".join(results)) |
388 | 70 | 70 | ||
389 | 71 | def display_character(self, character): | 71 | def display_character(self, character): |
390 | 72 | desc = u"%s: %s." % (character.characterID, character["long imdb name"]) | 72 | desc = u"%s: %s." % (character.characterID, character["long imdb name"]) |
391 | 73 | 73 | ||
392 | === modified file 'ibid/plugins/info.py' | |||
393 | --- ibid/plugins/info.py 2009-02-23 20:29:44 +0000 | |||
394 | +++ ibid/plugins/info.py 2009-02-26 09:53:00 +0000 | |||
395 | @@ -41,7 +41,7 @@ | |||
396 | 41 | def handle_nickometer(self, event, nick, wreasons): | 41 | def handle_nickometer(self, event, nick, wreasons): |
397 | 42 | nick = nick or event.sender['nick'] | 42 | nick = nick or event.sender['nick'] |
398 | 43 | score, reasons = nickometer(str(nick)) | 43 | score, reasons = nickometer(str(nick)) |
400 | 44 | event.addresponse(u"%s is %s%% lame" % (nick, score)) | 44 | event.addresponse(u"%s is %s%% lame", nick, score) |
401 | 45 | if wreasons: | 45 | if wreasons: |
402 | 46 | event.addresponse(u', '.join(['%s (%s)' % reason for reason in reasons])) | 46 | event.addresponse(u', '.join(['%s (%s)' % reason for reason in reasons])) |
403 | 47 | 47 | ||
404 | 48 | 48 | ||
405 | === modified file 'ibid/plugins/irc.py' | |||
406 | --- ibid/plugins/irc.py 2009-02-12 19:59:13 +0000 | |||
407 | +++ ibid/plugins/irc.py 2009-02-26 09:53:00 +0000 | |||
408 | @@ -27,15 +27,15 @@ | |||
409 | 27 | source = ibid.sources[source.lower()] | 27 | source = ibid.sources[source.lower()] |
410 | 28 | 28 | ||
411 | 29 | if not hasattr(source, 'join'): | 29 | if not hasattr(source, 'join'): |
413 | 30 | event.addresponse(u"%s cannot join/part channels" % (source.name,)) | 30 | event.addresponse(u"%s cannot join/part channels", source.name) |
414 | 31 | return | 31 | return |
415 | 32 | 32 | ||
416 | 33 | if action == 'join': | 33 | if action == 'join': |
417 | 34 | source.join(channel) | 34 | source.join(channel) |
419 | 35 | event.addresponse(u"Joining %s" % channel) | 35 | event.addresponse(u"Joining %s", channel) |
420 | 36 | else: | 36 | else: |
421 | 37 | source.part(channel) | 37 | source.part(channel) |
423 | 38 | event.addresponse(u"Parting %s" % channel) | 38 | event.addresponse(u"Parting %s", channel) |
424 | 39 | 39 | ||
425 | 40 | @match(r'^change\s+nick\s+to\s+(\S+)(?:\s+on\s+(\S+))?$') | 40 | @match(r'^change\s+nick\s+to\s+(\S+)(?:\s+on\s+(\S+))?$') |
426 | 41 | @authorise | 41 | @authorise |
427 | @@ -46,9 +46,9 @@ | |||
428 | 46 | source = ibid.sources[source.lower()] | 46 | source = ibid.sources[source.lower()] |
429 | 47 | 47 | ||
430 | 48 | if not hasattr(source, 'change_nick'): | 48 | if not hasattr(source, 'change_nick'): |
432 | 49 | event.addresponse(u"%s cannot change nicks" % source) | 49 | event.addresponse(u"%s cannot change nicks", source) |
433 | 50 | else: | 50 | else: |
434 | 51 | source.change_nick(nick) | 51 | source.change_nick(nick) |
436 | 52 | event.addresponse(u'Changing nick to %s' % nick) | 52 | event.addresponse(u'Changing nick to %s', nick) |
437 | 53 | 53 | ||
438 | 54 | # vi: set et sta sw=4 ts=4: | 54 | # vi: set et sta sw=4 ts=4: |
439 | 55 | 55 | ||
440 | === modified file 'ibid/plugins/karma.py' | |||
441 | --- ibid/plugins/karma.py 2009-02-23 20:29:44 +0000 | |||
442 | +++ ibid/plugins/karma.py 2009-02-26 09:53:00 +0000 | |||
443 | @@ -94,9 +94,9 @@ | |||
444 | 94 | session = ibid.databases.ibid() | 94 | session = ibid.databases.ibid() |
445 | 95 | karma = session.query(Karma).filter(func.lower(Karma.subject)==subject.lower()).first() | 95 | karma = session.query(Karma).filter(func.lower(Karma.subject)==subject.lower()).first() |
446 | 96 | if not karma: | 96 | if not karma: |
448 | 97 | event.addresponse(u"%s has neutral karma" % subject) | 97 | event.addresponse(u"%s has neutral karma",subject) |
449 | 98 | else: | 98 | else: |
451 | 99 | event.addresponse(u"%s has karma of %s" % (subject, karma.value)) | 99 | event.addresponse(u"%s has karma of %s", subject, karma.value) |
452 | 100 | session.close() | 100 | session.close() |
453 | 101 | 101 | ||
454 | 102 | @match(r'^(reverse\s+)?karmaladder$') | 102 | @match(r'^(reverse\s+)?karmaladder$') |
455 | 103 | 103 | ||
456 | === modified file 'ibid/plugins/lookup.py' | |||
457 | --- ibid/plugins/lookup.py 2009-02-22 10:37:32 +0000 | |||
458 | +++ ibid/plugins/lookup.py 2009-02-26 09:53:00 +0000 | |||
459 | @@ -243,9 +243,9 @@ | |||
460 | 243 | def weather(self, event, place): | 243 | def weather(self, event, place): |
461 | 244 | try: | 244 | try: |
462 | 245 | values = self.remote_weather(place) | 245 | values = self.remote_weather(place) |
464 | 246 | event.addresponse(u'In %(place)s at %(time)s: %(temp)s; Humidity: %(humidity)s; Wind: %(wind)s; Conditions: %(conditions)s; Sunrise/set: %(sunrise)s/%(sunset)s; Moonrise/set: %(moonrise)s/%(moonset)s' % values) | 246 | event.addresponse(u'In %(place)s at %(time)s: %(temp)s; Humidity: %(humidity)s; Wind: %(wind)s; Conditions: %(conditions)s; Sunrise/set: %(sunrise)s/%(sunset)s; Moonrise/set: %(moonrise)s/%(moonset)s', values) |
465 | 247 | except Weather.TooManyPlacesException, e: | 247 | except Weather.TooManyPlacesException, e: |
467 | 248 | event.addresponse(u'Too many places match %s: %s' % (place, '; '.join(e.message))) | 248 | event.addresponse(u'Too many places match %s: %s', place, '; '.join(e.message)) |
468 | 249 | except Weather.WeatherException, e: | 249 | except Weather.WeatherException, e: |
469 | 250 | event.addresponse(e.message) | 250 | event.addresponse(e.message) |
470 | 251 | 251 | ||
471 | @@ -254,7 +254,7 @@ | |||
472 | 254 | try: | 254 | try: |
473 | 255 | event.addresponse(u', '.join(self.remote_forecast(place))) | 255 | event.addresponse(u', '.join(self.remote_forecast(place))) |
474 | 256 | except Weather.TooManyPlacesException, e: | 256 | except Weather.TooManyPlacesException, e: |
476 | 257 | event.addresponse(u'Too many places match %s: %s' % (place, '; '.join(e.message))) | 257 | event.addresponse(u'Too many places match %s: %s', place, '; '.join(e.message)) |
477 | 258 | except Weather.WeatherException, e: | 258 | except Weather.WeatherException, e: |
478 | 259 | event.addresponse(e.message) | 259 | event.addresponse(e.message) |
479 | 260 | 260 | ||
480 | 261 | 261 | ||
481 | === modified file 'ibid/plugins/memo.py' | |||
482 | --- ibid/plugins/memo.py 2009-02-23 20:29:44 +0000 | |||
483 | +++ ibid/plugins/memo.py 2009-02-26 09:53:00 +0000 | |||
484 | @@ -60,11 +60,11 @@ | |||
485 | 60 | if not identity: | 60 | if not identity: |
486 | 61 | identity = account.identities[0] | 61 | identity = account.identities[0] |
487 | 62 | if not to: | 62 | if not to: |
489 | 63 | event.addresponse(u"I don't know who %s is" % who) | 63 | event.addresponse(u"I don't know who %s is", who) |
490 | 64 | return | 64 | return |
491 | 65 | 65 | ||
492 | 66 | if permission(u'recvmemo', to.account and to.account.id or None, to.source) != 'yes': | 66 | if permission(u'recvmemo', to.account and to.account.id or None, to.source) != 'yes': |
494 | 67 | event.addresponse(u'Just tell %s yourself' % who) | 67 | event.addresponse(u'Just tell %s yourself', who) |
495 | 68 | return | 68 | return |
496 | 69 | 69 | ||
497 | 70 | memo = Memo(event.identity, to.id, memo, how.lower() in ('pm', 'privmsg', 'msg')) | 70 | memo = Memo(event.identity, to.id, memo, how.lower() in ('pm', 'privmsg', 'msg')) |
498 | @@ -153,7 +153,7 @@ | |||
499 | 153 | session = ibid.databases.ibid() | 153 | session = ibid.databases.ibid() |
500 | 154 | memos = get_memos(session, event, True) | 154 | memos = get_memos(session, event, True) |
501 | 155 | memo = memos[int(number)] | 155 | memo = memos[int(number)] |
503 | 156 | event.addresponse(u"From %s on %s at %s: %s" % (memo.sender.identity, memo.sender.source, memo.time.strftime(self.datetime_format), memo.memo)) | 156 | event.addresponse(u"From %s on %s at %s: %s", memo.sender.identity, memo.sender.source, memo.time.strftime(self.datetime_format), memo.memo) |
504 | 157 | session.close() | 157 | session.close() |
505 | 158 | 158 | ||
506 | 159 | 159 | ||
507 | 160 | 160 | ||
508 | === modified file 'ibid/plugins/misc.py' | |||
509 | --- ibid/plugins/misc.py 2009-02-23 20:29:44 +0000 | |||
510 | +++ ibid/plugins/misc.py 2009-02-26 09:53:00 +0000 | |||
511 | @@ -26,7 +26,7 @@ | |||
512 | 26 | 26 | ||
513 | 27 | self.pot = [event.sender['nick']] | 27 | self.pot = [event.sender['nick']] |
514 | 28 | sleep(self.time) | 28 | sleep(self.time) |
516 | 29 | event.addresponse(u"Coffee's ready for %s!" % u', '.join(self.pot)) | 29 | event.addresponse(u"Coffee's ready for %s!", u', '.join(self.pot)) |
517 | 30 | self.pot = None | 30 | self.pot = None |
518 | 31 | return event | 31 | return event |
519 | 32 | 32 | ||
520 | @@ -53,7 +53,7 @@ | |||
521 | 53 | 53 | ||
522 | 54 | @match(r'^version$') | 54 | @match(r'^version$') |
523 | 55 | def show_version(self, event): | 55 | def show_version(self, event): |
525 | 56 | event.addresponse(version and u"I am version %s" % version or u"I don't know what version I am :-(") | 56 | event.addresponse(version and u"I am version %s" or u"I don't know what version I am :-(", version) |
526 | 57 | 57 | ||
527 | 58 | help['dvorak'] = u"Makes text typed on a QWERTY keyboard as if it was Dvorak work, and vice-versa" | 58 | help['dvorak'] = u"Makes text typed on a QWERTY keyboard as if it was Dvorak work, and vice-versa" |
528 | 59 | class Dvorak(Processor): | 59 | class Dvorak(Processor): |
529 | 60 | 60 | ||
530 | === modified file 'ibid/plugins/network.py' | |||
531 | --- ibid/plugins/network.py 2009-02-03 18:03:49 +0000 | |||
532 | +++ ibid/plugins/network.py 2009-02-26 09:53:00 +0000 | |||
533 | @@ -34,10 +34,10 @@ | |||
534 | 34 | try: | 34 | try: |
535 | 35 | answers = resolver.query(host, str(record)) | 35 | answers = resolver.query(host, str(record)) |
536 | 36 | except NoAnswer: | 36 | except NoAnswer: |
538 | 37 | event.addresponse(u"I couldn't find any %s records for %s" % (record, host)) | 37 | event.addresponse(u"I couldn't find any %s records for %s", record, host) |
539 | 38 | return | 38 | return |
540 | 39 | except NXDOMAIN: | 39 | except NXDOMAIN: |
542 | 40 | event.addresponse(u"I couldn't find the domain %s" % host) | 40 | event.addresponse(u"I couldn't find the domain %s", host) |
543 | 41 | return | 41 | return |
544 | 42 | 42 | ||
545 | 43 | responses = [] | 43 | responses = [] |
546 | 44 | 44 | ||
547 | === modified file 'ibid/plugins/seen.py' | |||
548 | --- ibid/plugins/seen.py 2009-02-18 19:05:10 +0000 | |||
549 | +++ ibid/plugins/seen.py 2009-02-26 09:53:00 +0000 | |||
550 | @@ -82,7 +82,7 @@ | |||
551 | 82 | account = session.query(Account).filter_by(username=who).first() | 82 | account = session.query(Account).filter_by(username=who).first() |
552 | 83 | 83 | ||
553 | 84 | if not identity and not account: | 84 | if not identity and not account: |
555 | 85 | event.addresponse(u"I don't know who %s is" % who) | 85 | event.addresponse(u"I don't know who %s is", who) |
556 | 86 | return | 86 | return |
557 | 87 | 87 | ||
558 | 88 | messages = [] | 88 | messages = [] |
559 | @@ -102,7 +102,7 @@ | |||
560 | 102 | states.append(sighting) | 102 | states.append(sighting) |
561 | 103 | 103 | ||
562 | 104 | if len(messages) == 0 and len(states) == 0: | 104 | if len(messages) == 0 and len(states) == 0: |
564 | 105 | event.addresponse(u"I haven't seen %s" % who) | 105 | event.addresponse(u"I haven't seen %s", who) |
565 | 106 | return | 106 | return |
566 | 107 | 107 | ||
567 | 108 | messages.sort(key=lambda x: x.time, reverse=True) | 108 | messages.sort(key=lambda x: x.time, reverse=True) |
568 | 109 | 109 | ||
569 | === modified file 'ibid/plugins/sources.py' | |||
570 | --- ibid/plugins/sources.py 2009-02-17 21:04:17 +0000 | |||
571 | +++ ibid/plugins/sources.py 2009-02-26 09:53:00 +0000 | |||
572 | @@ -15,26 +15,26 @@ | |||
573 | 15 | def connect(self, event, source): | 15 | def connect(self, event, source): |
574 | 16 | 16 | ||
575 | 17 | if ibid.sources[source.lower()].connect(): | 17 | if ibid.sources[source.lower()].connect(): |
577 | 18 | event.addresponse(u'Connecting to %s' % source) | 18 | event.addresponse(u'Connecting to %s', source) |
578 | 19 | else: | 19 | else: |
580 | 20 | event.addresponse(u"I couldn't connect to %s" % source) | 20 | event.addresponse(u"I couldn't connect to %s", source) |
581 | 21 | 21 | ||
582 | 22 | @match(r'^disconnect\s+(?:from\s+)?(\S+)$') | 22 | @match(r'^disconnect\s+(?:from\s+)?(\S+)$') |
583 | 23 | @authorise | 23 | @authorise |
584 | 24 | def disconnect(self, event, source): | 24 | def disconnect(self, event, source): |
585 | 25 | 25 | ||
586 | 26 | if ibid.sources[source.lower()].disconnect(): | 26 | if ibid.sources[source.lower()].disconnect(): |
588 | 27 | event.addresponse(u'Disconnecting from %s' % source) | 27 | event.addresponse(u'Disconnecting from %s', source) |
589 | 28 | else: | 28 | else: |
591 | 29 | event.addresponse(u"I couldn't disconnect from %s" % source) | 29 | event.addresponse(u"I couldn't disconnect from %s", source) |
592 | 30 | 30 | ||
593 | 31 | @match(r'^(?:re)?load\s+(\S+)\s+source$') | 31 | @match(r'^(?:re)?load\s+(\S+)\s+source$') |
594 | 32 | @authorise | 32 | @authorise |
595 | 33 | def load(self, event, source): | 33 | def load(self, event, source): |
596 | 34 | if ibid.reloader.load_source(source, ibid.service): | 34 | if ibid.reloader.load_source(source, ibid.service): |
598 | 35 | event.addresponse(u"%s source loaded" % source) | 35 | event.addresponse(u"%s source loaded", source) |
599 | 36 | else: | 36 | else: |
601 | 37 | event.addresponse(u"Couldn't load %s source" % source) | 37 | event.addresponse(u"Couldn't load %s source", source) |
602 | 38 | 38 | ||
603 | 39 | class Info(Processor): | 39 | class Info(Processor): |
604 | 40 | """(sources|list configured sources)""" | 40 | """(sources|list configured sources)""" |
605 | 41 | 41 | ||
606 | === modified file 'ibid/plugins/test.py' | |||
607 | --- ibid/plugins/test.py 2009-01-12 17:35:59 +0000 | |||
608 | +++ ibid/plugins/test.py 2009-02-26 09:53:00 +0000 | |||
609 | @@ -25,6 +25,6 @@ | |||
610 | 25 | @match(r'^email\s+(.+)$') | 25 | @match(r'^email\s+(.+)$') |
611 | 26 | def email(self, event, address): | 26 | def email(self, event, address): |
612 | 27 | event.addresponse({'reply': 'Test message', 'source': 'email', 'target': unicode(address)}) | 27 | event.addresponse({'reply': 'Test message', 'source': 'email', 'target': unicode(address)}) |
614 | 28 | event.addresponse(u"I've emailed %s" % address) | 28 | event.addresponse(u"I've emailed %s", address) |
615 | 29 | 29 | ||
616 | 30 | # vi: set et sta sw=4 ts=4: | 30 | # vi: set et sta sw=4 ts=4: |
I have altered the addresponse code to take *args and run them against a template string (if handed one). If it fails for some reason it will fall back to the vanilla response it was handed, and discard the args.
I have touched all the plugins which user '%s' % arg format, and rewritten where possible. Some of the modules do some funky logic, and their flow would have to be changed to be fully translatable.