Merge lp://qastaging/~anarcat/ibid/remind-648463 into lp://qastaging/~ibid-core/ibid/old-trunk-1.6
- remind-648463
- Merge into old-trunk-1.6
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1017 | ||||
Proposed branch: | lp://qastaging/~anarcat/ibid/remind-648463 | ||||
Merge into: | lp://qastaging/~ibid-core/ibid/old-trunk-1.6 | ||||
Diff against target: |
143 lines (+103/-2) 2 files modified
AUTHORS (+1/-0) ibid/plugins/fun.py (+102/-2) |
||||
To merge this branch: | bzr merge lp://qastaging/~anarcat/ibid/remind-648463 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Max Rabkin | Needs Fixing | ||
anarcat (community) | final review please | Needs Resubmitting | |
marcog (community) | Needs Fixing | ||
Stefano Rivera | Approve | ||
Jonathan Hitchcock | Pending | ||
Ibid Core Team | testing, pythonicity, style | Pending | |
Review via email:
|
This proposal supersedes a proposal from 2010-11-04.
Commit message
Description of the change
see #648463.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
What Marco means is that since you branched from trunk, someone else has touched AUTHORS.
So you need to either:
bzr merge lp:ibid
Fix AUTHORS
bzr resolved AUTHORS
bzr commit -m "Merge from trunk"
bzr push
Or
bzr rebase lp:ibid
Fix AUTHORS
bzr resalved AUTHORS
bzr rebase-continue
bzr push
The first one puts the trunk changes after your changes (which is actually correct, but can get a bit messy). The rebase option puts the trunk changes *before* your changes (you need bzr-rewrite installed to do it), which messes with anyone who's already using your branch, but gives a prettier history.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jonathan Hitchcock (vhata) wrote : Posted in a previous version of this proposal | # |
- AUTHORS file has clashes in it.
- parser exceptions aren't handled
- the messages could do with a bit of punctuation and cleaning up
Otherwise, good start!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
34 from ibid.utils import human_join, indefinite_article, identity_name, \
35 plural
36 +from ibid.utils import ago, format_date
37 +
Those should be joined.
For the addresponses, please use dictionary-style substitions, i.e.
112 + event.addrespon
becomes
event.addrespon
'who': who,
'time': ago(delta),
})
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
I fixed the clashes. Couldn't rebase as I don't have a recent enough bzr (!? debian squeeze?).
I feel that it's not a problem that parser exceptions are not handled: the bot just complains ("burp" and so on) and the user will figure it out... But I have implemented a handler anyways, I hope it's the right wording.
I have worked quite a lot on the messages (see bug report), so I would like specifics here before starting to hack at this again.
Thanks!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
My comments in my last review still stand.
Yes, you should catch parser exceptions, otherwise user-mistakes show up in the bot-owner's logs. The current message isn't very good, many people don't know what parsing is. "Sorry, but I couldn't understand the time you gave me"
u'Generic timed reminders' <- that's a bit generic, something a little more descriptive would be good.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : Posted in a previous version of this proposal | # |
Nice to see a new name in my review list!
64 + event.addrespon
(and two lines down)
We generally don't include the "%s:" in private messages, so you might want to check event.public.
Your total_seconds variable appears to contain a number of microseconds, so it should be called total_microseconds.
68 + @match(
You're inconsistent between '\s+' and ' '. Use ' ' (match turns it into '\s+' automatically). You also don't need the ^ and $.
Also, the only thing you do with the variable how is add it to what -- why not just match use '(.*)?' instead of '(?:(about|of|to) (.*))?'. This will also let one say "remind Taejo in 10 seconds to feed the cat".
It would be nice if we could allow "remind Taejo to feed the cat in 10 seconds", which is more natural, but I realise that the regex might get a little tricky.
Please use full sentences in docstrings. Start sentences with capitals and end them with periods.
When I tried "ping me at 10:50", I got this:
Traceback (most recent call last):
File "/home/
processor.
File "/home/
method(event, *match.groups())
File "/home/
ibid.
UnboundLocalError: local variable 'now' referenced before assignment
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> Nice to see a new name in my review list!
Thanks for all the reviews...
> 64 + event.addrespon
> ago.', (who, from_who, what, ago(datetime.
>
> (and two lines down)
>
> We generally don't include the "%s:" in private messages, so you might want to
> check event.public.
Fixed.
> Your total_seconds variable appears to contain a number of microseconds, so it
> should be called total_microseconds.
That is incorrect: it's a number of seconds. It's a reimplementation of delta.total_
> 68 +
> @match(
> (.*))?$')
>
> You're inconsistent between '\s+' and ' '. Use ' ' (match turns it into '\s+'
> automatically). You also don't need the ^ and $.
fixed. i also added please.
> Also, the only thing you do with the variable how is add it to what -- why not
> just match use '(.*)?' instead of '(?:(about|of|to) (.*))?'. This will also
> let one say "remind Taejo in 10 seconds to feed the cat".
the problem is we need a token here to avoid eating the whole "what" with the time regex. since the time string can be very flexible, i'm not sure i can match it with a regex, so I prefer to have a bunch of keywords that allows us to parse the string better.
I don't see why we can't do what you want here anyways:
09:33:21 <anarcat> ibicat: remind me in 10 seconds to feed the cat
09:33:21 <ibicat> anarcat: okay, I will remind you in 10 seconds
09:33:31 <ibicat> anarcat: you asked me to remind you to feed the cat, 10 seconds ago.
> It would be nice if we could allow "remind Taejo to feed the cat in 10
> seconds", which is more natural, but I realise that the regex might get a
> little tricky.
Yeah, and then the argument order in the callback would be screwed up. This is actually how I started too, but then I switched, I don't remember why.
Maybe the arguments could be "named"? I'm not sure how to do this in this context...
> Please use full sentences in docstrings. Start sentences with capitals and end
> them with periods.
Fixed.
> When I tried "ping me at 10:50", I got this:
Fixed.
Now onto other reviews.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> My comments in my last review still stand.
>
> Yes, you should catch parser exceptions, otherwise user-mistakes show up in
> the bot-owner's logs. The current message isn't very good, many people don't
> know what parsing is. "Sorry, but I couldn't understand the time you gave me"
>
> u'Generic timed reminders' <- that's a bit generic, something a little more
> descriptive would be good.
Both fixed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
I have also fixed the addresponse() to use dictionnaries instead of printf-style interpolation.
I have yet to fix the order and flexibility of the regex. I feel this is not critical and can be fixed later. I have introduce a bunch of changes here and I'm hesitant to break this furthermore.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
One last comment here: to allow both "ping me in 5 about foo" and "ping me about foo in 5", we would need to allow for named subgroups to be passed as named arguments to the match function.
This doesn't document this as being possible:
http://
... so I will not struggle with it for now. But basically, I think what I would like is this:
@match(
def remind(self, event, who, at, when, how, what):
... and of course whatever is responsible for calling remind() would need to pass the regex dictionnary. This would also require to have multiple regex in the @match() block to allow us to have different patterns that would match the same callback (is that possible now?).
tumbleweed mentionned on irc how named groups would be useful for i18n eventually.
oh, and I have more stuff to push, the dictionnary thing is broken. hold on.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : Posted in a previous version of this proposal | # |
<Taejo> Ibido: remind me at 11:00 about the cat
<Ibido> Taejo: I can't travel in time back to 22 minutes and 33 seconds ago (yet) so I'll tell you now about the cat
Haha, very nice.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
Aaaaalmost there.
> from datetime import datetime
That belongs with the stdlib imports
16:54 <@tumbleweed> tibid: remind me in half an hour about DL meeting
16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
16:54 <@tumbleweed> tibid: remind me in 30 mins about DL meeting
16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
16:54 <@tumbleweed> tibid: remind me in 30 min about DL meeting
16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
16:54 <@tumbleweed> tibid: remind me in 30 minutes about DL meeting
16:54 < tibid> tumbleweed: okay, I will remind you in 30 minutes
Pity abbreviations don't work...
> "okay, I will"...
That should be "Okay, I will"...
> "you asked me"
Same there
135 + if what:
136 + event.addrespon
137 + 'who': who,
138 + 'time': ago(delta)
139 + })
140 + else:
141 + event.addrespon
142 + 'who': who,
143 + 'time': ago(delta)
144 + })
Seems like unnecessary duplication. Easily solved with %(action)s.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
Whoops:
2010-10-07 16:59:43,336 ERROR core.dispatcher: Exception occured in Remind processor of fun plugin.
Event: {'account': 1, 'responses': [{'reply': u"I can't travel in time back to 15 hours, 59 minutes and 43 seconds ago (yet) so I'll tell you now to test", 'address': True, 'target': u'tumbleweed!<email address hidden>', 'conflate': True, 'source': u'atrum'}], 'source': u'atrum', 'addressed': True, 'processed': True, 'time': datetime.
Traceback (most recent call last):
File "/home/
processor.
File "/home/
method(event, *match.groups())
File "/home/
ibid.
File "/home/
return reactor.
File "/usr/lib/
"%s is not greater than or equal to 0 seconds" % (_seconds,)
AssertionError: -57584 is not greater than or equal to 0 seconds
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : Posted in a previous version of this proposal | # |
17:28 <marcog> remind me in 0 minutes about food
17:28 <tibid> okay, I will remind you in
17:28 <tibid> you asked me to remind you about food, 12 milliseconds ago.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : Posted in a previous version of this proposal | # |
How about adding an "announce <announcement> at 5pm"? Perhaps a second iteration.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : Posted in a previous version of this proposal | # |
17:29 <marcog> remind me to eat in 3 seconds
17:29 <tibid> Hello remind me to eat in 3 second
This ordering should work. The response is probably a weird match-alot wildcarded factoid, so ignore that.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : Posted in a previous version of this proposal | # |
I like "announce" without any target.
As anarcat noted, alternative orders will be much easier when we fix #656201 (Named groups in match regexes) -- and I'm planning to do that soon.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jonathan Hitchcock (vhata) wrote : Posted in a previous version of this proposal | # |
12:32 <Vhata> tibid: remind me at 12:30 about foo
12:32 <tibid> Vhata: I can't travel in time back to 2 minutes and 16 seconds ago (yet) so I'll tell you now about foo
It's cute, but that's not what a human would do. I'd prefer: "I assume you mean 12:30 tomorrow - I'll tell you about foo then" (or something)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : Posted in a previous version of this proposal | # |
13:26 < drubin> Maaz: remind drubin to follow up on
http://
13:26 < Maaz> drubin: Excuse me?
13:26 < drubin> bad bot
I know Maaz doesn't have this brach merged, but AFAIK we don't handle this case of "remind me about X" without a time. I can't think of a best way to handle it except for maybe sending a memo the first time the user does something after one hour.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> 17:29 <marcog> remind me to eat in 3 seconds
> 17:29 <tibid> Hello remind me to eat in 3 second
>
> This ordering should work. The response is probably a weird match-alot
> wildcarded factoid, so ignore that.
I don't see that here.
16:25:17 <anarcat> ibicat: remind me to eat in 3 seconds
16:25:18 <ibicat> anarcat: Sorry...
Furthermore, I think that problem is related to the fact we don't allow named regex match groups which would allow me to support variable orders like this. For now, I am limited by the API and can't match both:
remind me in 1 minute about foo
and
remind me about foo in 1 minute
so we'll have to decide on which for now.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> Aaaaalmost there.
>
> > from datetime import datetime
>
> That belongs with the stdlib imports
Not sure what this means, should I move the import? Should I "import as"?
> 16:54 <@tumbleweed> tibid: remind me in half an hour about DL meeting
> 16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
> 16:54 <@tumbleweed> tibid: remind me in 30 mins about DL meeting
> 16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
> 16:54 <@tumbleweed> tibid: remind me in 30 min about DL meeting
> 16:54 < tibid> tumbleweed: Sorry, I couldn't understand the time you gave me
> 16:54 <@tumbleweed> tibid: remind me in 30 minutes about DL meeting
> 16:54 < tibid> tumbleweed: okay, I will remind you in 30 minutes
>
> Pity abbreviations don't work...
Yeah, sorry..
> > "okay, I will"...
>
> That should be "Okay, I will"...
fixed.
> > "you asked me"
>
> Same there
fixed.
> 135 + if what:
> 136 + event.addrespon
> %(time)s", {
> 137 + 'who': who,
> 138 + 'time': ago(delta)
> 139 + })
> 140 + else:
> 141 + event.addrespon
> %(time)s", {
> 142 + 'who': who,
> 143 + 'time': ago(delta)
> 144 + })
>
> Seems like unnecessary duplication. Easily solved with %(action)s.
fixed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> Whoops:
>
[...]
> AssertionError: -57584 is not greater than or equal to 0 seconds
also fixed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
> 17:28 <marcog> remind me in 0 minutes about food
> 17:28 <tibid> okay, I will remind you in
> 17:28 <tibid> you asked me to remind you about food, 12 milliseconds ago.
This is a bug with "ago()". I have now a special handler in my code for this, but I consider this bug outside the scope of this...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
I have added "remind" the list of allowed aliases for the "tell" plugin so that you can do:
17:15:10 <anarcat> ibicat: remind anarcat about foo
17:15:11 <ibicat> anarcat: Yessir
17:15:13 <anarcat> foo
17:15:14 <ibicat> anarcat: By the way, anarcat on IMC told me "remind anarcat about foo" 3 seconds ago
Now we could expand the regex of the tell, and ideally merge those two plugins, but I think this is currently okay and refactoring could happen after merge... don't you think? :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : Posted in a previous version of this proposal | # |
Of course I approve my own changes here. :) I think I have repeatedly addressed all concerns addressed here.
The *only* things that would remain here, but I think should be in a second phase, are:
1. "announcements" for everyone to hear
2. merge with the memo plugin: share the syntax and the decorators
3. merge with memo: make a memo if the person is not there at the given time
Since i do not think those should be blocking the merge, i am approving this. :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
> Not sure what this means, should I move the import? Should I "import as"?
I mean with the first block of imports, the ones from the standard library, as opposed to being next to dateutil. Above unicodedata, not above dateutil.
> Of course I approve my own changes here.
That's taken for-granted :P You shouldn't review your own merge request.
I see a conflict in memo. In fact, I don't understand why we change memo, now memo conflicts with remind:
22:45 < tumbleweed> tibid: remind me in 5 minutes about something
22:45 < tibid> tumbleweed: Got it, I'll remind me on atrum
That's presumably not what we want.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : | # |
I again had problems with bzr, but I tried to push a fix for stefano's concerns:
anarcat@
Enter passphrase for key '/home/
Traceback (most recent call last):
File "/srv/bazaar.
self.result = callback(
File "/srv/bazaar.
control_string, branch_string, repository_string)
File "/srv/bazaar.
repository_
File "/srv/bazaar.
method_name, *args, **kwargs)
--- <exception caught here> ---
File "/srv/bazaar.
result = f(*args, **kw)
File "/srv/bazaar.
return getattr(
File "/usr/lib/
return self.__
File "/usr/lib/
verbose=
File "/usr/lib/
return self._parse_
File "/usr/lib/
return u.close()
File "/usr/lib/
raise Fault(*
xmlrpclib.Fault: <Fault -1: 'Unexpected Zope exception: AssertionError: '>
Pushed up to revision 978.
anarcat@
Enter passphrase for key '/home/
Traceback (most recent call last):
File "/srv/bazaar.
self.result = callback(
File "/srv/bazaar.
control_string, branch_string, repository_string)
File "/srv/bazaar.
repository_
File "/srv/bazaar.
method_name, *args, **kwargs)
--- <exception caught here> ---
File "/srv/bazaar.
result = f(*args, **kw)
File "/srv/bazaar.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
OK, I guess I'm happy, there's still a blank line below "from dateutil import parser" that should go.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
usage = u'remind <person> in <time> about <something>'
"in" should be "(in|at)"
> OK, I guess I'm happy, there's still a blank line below "from dateutil import parser" that should go.
I think Stefano means the blank line *above*, since dateutil is in the standard libraries.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
Nope, I did mean what I said http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
> Nope, I did mean what I said http://
Right. I misread this: "The dateutil module provides powerful
extensions to the standard datetime module, available in Python 2.3+."
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
<Taejo> tibid: remind DeFi on 25/12/2010 that Kev wishes him a Merry Christmas
<tibid> Taejo: Sorry, I couldn't understand the time you gave me
<Taejo> tibid: remind DeFi on 12/25/2010 that Kev wishes him a Merry Christmas
<tibid> Taejo: Sorry, I couldn't understand the time you gave me
<Taejo> tibid: remind DeFi tomorrow that Kev wishes him a Merry Christmas
<tibid> Hello remind DeFi tomorrow that Kev wishes him a Merry Christma
<Taejo> tibid: remind DeFi on 25 December that Kev wishes him a Merry Christmas
<tibid> Taejo: Sorry, I couldn't understand the time you gave me
The "hello" is just a factoid, but what concerns me is that there is no clue what is and isn't allowed... after lots and lots of pointless exploration it turns out "25th December 2010" works. Is there no better date parser available?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
\w+ doesn't work for who -- IRC allows, for example, | in nicks.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : | # |
> <Taejo> tibid: remind DeFi on 25/12/2010 that Kev wishes him a Merry Christmas
> <tibid> Taejo: Sorry, I couldn't understand the time you gave me
> <Taejo> tibid: remind DeFi on 12/25/2010 that Kev wishes him a Merry Christmas
> <tibid> Taejo: Sorry, I couldn't understand the time you gave me
> <Taejo> tibid: remind DeFi tomorrow that Kev wishes him a Merry Christmas
> <tibid> Hello remind DeFi tomorrow that Kev wishes him a Merry Christma
> <Taejo> tibid: remind DeFi on 25 December that Kev wishes him a Merry
> Christmas
> <tibid> Taejo: Sorry, I couldn't understand the time you gave me
>
> The "hello" is just a factoid, but what concerns me is that there is no clue
> what is and isn't allowed... after lots and lots of pointless exploration it
> turns out "25th December 2010" works. Is there no better date parser
> available?
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
> http://
LGTM. Can someone investigate where else it would be useful in Ibid? I seem to remember some time hacks in the timezone code.
I'm not mad about new dependencies, but this looks necessary.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : | # |
> > http://
>
> LGTM. Can someone investigate where else it would be useful in Ibid? I seem to
> remember some time hacks in the timezone code.
I'm going to do a quick trial in reminder to see the results.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
Can someone investigate where else it would be useful in Ibid?
These could almost certainly benefit from it:
geography.
meetings.
These would probably work with it:
scripts/ibid-*graph
That would leave us only using dateutil's TZ functionality, which may easily be implementable without dateutil.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : | # |
> Can someone investigate where else it would be useful in Ibid?
lp:~ibid-dev/ibid/parsedatetime implements this in remind, geography.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
OK, so this branch can be merged with poor quality time parsing, and Marco will improve it in his parsedatetime branch.
However, we still need to deal with the remaining issues here, Max and Marco are still waiting for things to be fixed. Marco promises to re-review and make it clear what he thinks still needs to be done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) wrote : | # |
I'm ignoring some little things I've already fixed in my branch, or things that will become non-issues or different issues in my branch.
> Maybe this should be merged with the memo plugin.
Remove this line. Also remember to remove the "remind" from memo as was mentioned above.
> usage = u'remind <person> in <time> about <something>'
Doesn't cover ping.
> who = who + ": "
Use who += ": "
> if what:
> event.addrespon
> ...
> else:
> event.addrespon
> ...
Firstly, these two can be combined into one. What if the users says "ping me in 5 minutes about foo"? Then you're going to say "You asked me to remind you about foo 5 minutes ago". Notice the ping vs remind.
> @match(r'(?:please )?(?:remind|
Is \w+ sufficient to match nicks?
Do we need the optional "please"? I think "alarm" is going to go unused (I haven't seen it used in testing once). I think "of" might be unnecessary. How about an "announce" which doesn't target an individual?
> from_who = event.sender[
You only use from_who 3 times. I'd rather use event.sender[
> who = who.strip()
This seems redundant as the nick will already be stripped.
> # XXX: this is total_seconds() in 2.7
If we want to keep this comment, please remove the "XXX:". I think it could be removed though.
> 'time': " in " + ago(delta) if delta else "",
We don't have a if b else c in 2.5, which ibid supports. There are other places you use this.
For future iterations (I think we should ignore these for the initial commit):
1. Use ibid accounts.
2. Add deletion of reminders.
3. Limit the number of unsent reminders per user (avoid spam).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
marcog (marco-gallotta) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : | # |
> I'm ignoring some little things I've already fixed in my branch, or things
> that will become non-issues or different issues in my branch.
>
> > Maybe this should be merged with the memo plugin.
>
> Remove this line. Also remember to remove the "remind" from memo as was
> mentioned above.
Okay, removed. The patch on memo.py has already been dropped.
> > usage = u'remind <person> in <time> about <something>'
>
> Doesn't cover ping.
That is on purpose. I was told to keep the usage simple so that people discover other natural occurences. The original usage covered all use cases and I was told to change it. See https:/
> > who = who + ": "
>
> Use who += ": "
Done.
> > if what:
> > event.addrespon
> %(ago)s ago.', {
> > ...
> > else:
> > event.addrespon
> ago.', {
> > ...
>
> Firstly, these two can be combined into one.
Done.
> What if the users says "ping me
> in 5 minutes about foo"? Then you're going to say "You asked me to remind you
> about foo 5 minutes ago". Notice the ping vs remind.
That is also on purpose: the idea is that "ping" is a like a "remind" but without a subject (a "what").
> > @match(r'(?:please )?(?:remind|
> .*?)(?:
>
> Is \w+ sufficient to match nicks?
Apparently not. A nickname is a hairy thing in IRC, according to RFC2812:
nickname = ( letter / special ) *8( letter / digit / special / "-" )
letter = %x41-5A / %x61-7A ; A-Z / a-z
digit = %x30-39 ; 0-9
special = %x5B-60 / %x7B-7D
I have updated the regex to follow that, but it's ugly and I'm uncertain of it now... but it seems to work:
17:40:20 <anarcat> ibicat: ping anarcat in 1 s
17:40:20 <ibicat> anarcat: Okay, I will ping you in 1 second
17:40:21 <ibicat> anarcat: You asked me to ping you, 1 second ago.
17:40:25 <anarcat> ibicat: ping anarca{}t in 1 s
17:40:25 <ibicat> anarcat: Okay, I will ping anarca{}t in 1 second
17:40:26 <ibicat> anarca{}t: anarcat asked me to ping you, 1 second ago.
> Do we need the optional "please"?
I think it's nice that the bot answers even if we are polite to him. I seem to remember seeing other instances of this in other plugins.
> I think "alarm" is going to go unused (I haven't seen it used in testing once).
We use it in another bot we're trying to replace here.
> I think "of" might be unnecessary.
You could ask "remind me of the nuclear meltdown in 200 years" or something... Would make sense in english, wouldn't it?
> How about an "announce" which doesn't target an individual?
That's an extra feature that's been requested elsewhere that is currently not targeted for this patch.
> > from_who = event.sender[
>
> You only use from_who 3 times. I'd rather use event.sender[
> to make the code easier to read.
I thought 3 was a good threshold, but okay, done.
> > who = who.strip()
>
> This seems redundant as the nick will already be stripped.
Indeed,...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
> I must state now that I am getting a bit tired of re-resubmitting that patch over and over again. I can't seem to get it right and there always seem to be a little thing to keep the patch from getting merged in.
I agree with you, and we are trying to make the process a little easier for newcomers. I'm sure you understand that we want to have clean, reliable and user-friendly code, though, and I'd like to assure you that your second merge will go a lot more smoothly having gone through this once.
If you can suggest any way we can be more welcoming to new contributors, I'd love to hear them. Perhaps we should be more involved in making some of the smaller changes ourselves (we generally leave everything up to the original author, but it doesn't have to be that way).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
anarcat (anarcat) wrote : | # |
> > I must state now that I am getting a bit tired of re-resubmitting that patch
> over and over again. I can't seem to get it right and there always seem to be
> a little thing to keep the patch from getting merged in.
>
> I agree with you, and we are trying to make the process a little easier for
> newcomers. I'm sure you understand that we want to have clean, reliable and
> user-friendly code, though, and I'd like to assure you that your second merge
> will go a lot more smoothly having gone through this once.
I'm happy to hear that, I and fully understand the intent here - I admire your perseverance in peer-reviewing the code, that is a good thing, even if painful for someone like me that comes from a much more relaxed culture in that regard.
> If you can suggest any way we can be more welcoming to new contributors, I'd
> love to hear them. Perhaps we should be more involved in making some of the
> smaller changes ourselves (we generally leave everything up to the original
> author, but it doesn't have to be that way).
I think doing the small changes yourselves would help, especially after the 5th submission of the patch... :) While Python is a very elegant language, not everyone is familiar with all the little idiosyncracies of it, and especially not from a "version-
For example, in this patch the second review request was mainly feature complete and didn't have any bugs reviewers could find. Subsequent reviews were all style issues and also broke down in more over-arching issues about the time/date parsing in the rest of the project, and which didn't concern this patch directly. I believe that #973 could have been committed and the issue be kept open for improvements. Instead, more small changes were requested to the patch, which added an extra month to the review process, and which brought us to november, and another iteration of mostly the same review, which brought us to 2011... and so on. :)
The fact that I wasn't familiar with bzr's and launchpad's peculiar development style made it difficult for me to send you good patches to review also. For example, I just now realized that I didn't *really* push the patch yesterday when I did a bzr push, I had to push to the specific branch... *ugh* :)
But I understand the need to have a formal review process and certainly appreciate that. I am worried that it makes contributions really hard on people. Maybe that's what I get for asking review on "pythonicity" and "style" though ;)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Max Rabkin (max-rabkin) wrote : | # |
> > Is \w+ sufficient to match nicks?
>
> Apparently not. A nickname is a hairy thing in IRC, according to RFC2812:
>
> nickname = ( letter / special ) *8( letter / digit / special / "-" )
>
> letter = %x41-5A / %x61-7A ; A-Z / a-z
> digit = %x30-39 ; 0-9
> special = %x5B-60 / %x7B-7D
> ; "[", "]", "\", "`", "_", "^", "{", "|", "}"
>
> I have updated the regex to follow that, but it's ugly and I'm uncertain of it
> now... but it seems to work:
Better to just use {chunk}, which matches any string of non-space characters -- not only is that complicated, but Ibid is not just for IRC, and some IRC servers allow a wider range of characters (my nick on irc.unilang.org is 대조). I'll fix it though.
8 +<<<<<<< TREE
9 * Kevin Woodland
10 +=======
11 + * Antoine Beaupré
12 +>>>>>>> MERGE-SOURCE
Borked merge