Maciej Szulik added the comment:
Here are my comments:
- roundup/pull_request.py
> def handle_comment(self, comment):
> url = self._get_url()
> issue_id = self._get_issue_id_using_url(url)
> if issue_id is not None:
> user_id = self.db.user.lookup("admin")
It would be nice to have the user configurable, not admin hardcoded.
> min_date = now - date.Interval("00:30")
It would be nice to have this value configurable, as well. Additionally, this
will allow you to set this value short for tests and make sure that comments
are applied when time delta is bigger than given value or not if shorter.
> if not bool(msg_ids):
There's no need to cast to bool, in Python empty collections are False.
In that case if msg_ids is sufficient in here.
> pr_exists = len(pr_id) == 1
> if pr_exists:
There's no need to create a variable here, just checking the condition is
perfectly fine, here:
if len(pr_id) == 1:
> def _get_comment(self):
> comment_user = self.data['comment']['user']['login'].encode('utf-8')
> comment = self.data['comment']['body'].encode('utf-8')
> url = self._get_url()
> return '%s left a comment on GitHub:\n\n%s\n\n%s' % (comment_user,
comment, url)
I thought we agreed just to have 'User X left a comment: linkt_to_pr'.
> now = date.Date(".")
> min_date = now - date.Interval("00:30")
> date_range_string = "from " + str(min_date)
Did that work for you? For me, and I've spent last hour or so trying it out it
did not.
But the form "date_from;date_to" worked properly. In that case I'd suggest
using:
date_range_string = str(min_date) + ";" + str(now)
since that one is working properly. The previous one is returning more than you
actually need.
_______________________________________________________
PSF Meta Tracker <[email protected]>
<http://psf.upfronthosting.co.za/roundup/meta/issue592>
_______________________________________________________
_______________________________________________
Tracker-discuss mailing list
[email protected]
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/