When we close or open an issue, the log which is recorded in Activity is that :- comment on issue
instead of :- closed issue or opened issue
as this is a notification.
Also later, other notifications (if they should be logged, instead of being logged as comment) can be added easily using this fix.
1 new commit added
I think I would rather that we do not log notifications (which allows not adding another argument to this method) and instead do another call to log_action() where needed with the appropriate action
Maybe we could just have two dictionaries, one for PR one for issues and take the verb there based on the log_type. This should simply quite a bit this bunch of if/elif/elif...
@pingou , ok , so i shall make changes only for the status of issue?
Both changes can be made, I'm proposing a different approach for both :)
rebased
Shouldn't it be status.lower()? IIRC status are Closed and Open
status.lower()
Closed
Open
yes , working on these :)
This two dicts aren't pep8 valid :)
One small style change, the rest looks good! :)
@pingou fixed pep8 error
Can you check once that self.issue and self.log_type in issue_verb works or not ? because according to https://www.mkyong.com/python/python-check-if-key-exists-in-dictionary/ This should work and it should be faster , what do you say ?
self.issue and self.log_type in issue_verb
``
h = {"apple":1 , "orange":2} "apple" in h True h.keys() ['orange', 'apple'] "apple" and 'orange' in h True "apple" and 'e' in h False ``
h = {"apple":1 , "orange":2} "apple" in h True h.keys() ['orange', 'apple'] "apple" and 'orange' in h True "apple" and 'e' in h False
Good catch, we should drop the .keys(), I even wrote about that a while back :) http://blog.pingoured.fr/index.php?post/2012/03/12/Python-notes-to-self
.keys()
@pingou @farhaan roger that :) , working on it
http://stackoverflow.com/questions/31738912/python-is-key-in-dict-different-faster-than-key-in-dict-keys
@pingou @farhaan tested and open for review :)
LGTM :)
Same here and the code is much cleaner, thanks!
Pull-Request has been merged by pingou
When we close or open an issue, the log which is recorded in Activity is that :-
comment on issue
instead of :-
closed issue opened issue
or
as this is a notification.
Also later, other notifications (if they should be logged, instead of being logged as comment) can be added easily using this fix.