Closed tatokis closed 1 year ago
This improvement makes sense. I guess the Python 3.5 requirement is not a problem as we depend on WebkitGtk4+ which on no system I know of is available with older Python version.
So I'd say let's merge this and maybe just add something like this to the plugin
import sys
MIN_PYTHON = (3, 5)
assert sys.version_info >= MIN_PYTHON, f"requires Python {'.'.join([str(n) for n in MIN_PYTHON])} or newer"
@tatokis What do you think about the suggestion above?
@lwindolf Sounds good to me.
Sorry, I was thinking of scrapping this entirely and instead of timing it, just clearing the message when the notification is dismissed (as there seems to be a closed event, but I haven't actually tested it, and I have the suspicion some implementations might not implement it correctly).
It is a good idea to use a monotonic clock as a way to check how much time has passed, as it will not be affected by the system clock changing (DST for example).
However, I am not sure what the minimum targeted Python 3 version is.
From the docs for
time.monotonic()
:If the minimum Python version is < 3.5, then a check needs to be added to use
time.monotonic()
if it's available.