resolve issue #2797 #2808
Merged
resolve issue #2797 #2808
Conversation
This reverts commit 03c70f0.
No need to call _set_timer_interval() at constructor since it's called every time timer is going to be started.
Can you please also add a test for this to |
multimpy_by = len(self._messages) + 1 | ||
if multimpy_by > 5: | ||
multimpy_by = 5 | ||
interval *= multimpy_by |
The-Compiler
Jul 10, 2017
Member
You could simply do interval *= min(5, len(self._messages) + 1)
Why the + 1
though?
You could simply do interval *= min(5, len(self._messages) + 1)
Why the + 1
though?
yashar-sb-sb
Jul 10, 2017
Author
Contributor
Because new message will be added after starting the timer.
That was the way it was done in the original code. I didn't want to change the ordering.
Because new message will be added after starting the timer.
That was the way it was done in the original code. I didn't want to change the ordering.
yashar-sb-sb
Jul 10, 2017
Author
Contributor
I can change The ordering and remove + 1
.
I can change The ordering and remove + 1
.
The-Compiler
Jul 10, 2017
Member
Ah, good catch! Yeah, I think it's safe to reorder it.
Ah, good catch! Yeah, I think it's safe to reorder it.
Okay I'll add the tests. |
Add tests for "Show messages longer if there are multiple of them."
Check for interval being positive instead of checking for it to be non-zero. So if somehow some unexpected thing happend and made message-timeout negative, the bug doesn't cascade.
Thanks! |
You're welcome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Show messages longer if there are multiple of them.
This change is