With the default parameters, after a colcon build finishes, the powershell window gets stuck on Summary: 1 package finished for a couple of seconds before giving control back to the user.
I noticed this was because of the time.sleep(5) on Line 90 here:
|
try: |
|
win32gui.Shell_NotifyIcon( |
|
win32gui.NIM_ADD, nid) |
|
win32gui.Shell_NotifyIcon( |
|
win32gui.NIM_MODIFY, ( |
|
hwnd, 0, win32gui.NIF_INFO, win32con.WM_USER + 20, hicon, |
|
'Balloon tooltip', message, 200, title)) |
|
except Exception as e: # noqa: F841 |
|
logger.debug( |
|
'Failed to show the notification: {e}'.format_map(locals())) |
|
else: |
|
# wait a while before destroying the window |
|
time.sleep(5) |
|
finally: |
|
win32gui.DestroyWindow(hwnd) |
Is there a reason to destroy the window? I commented out the line that destroys the window and the notification disappeared after a couple of seconds, and nothing seemed to go wrong.
If destroying the window is required, would it be possible to do this without having the sleep?
With the default parameters, after a
colcon buildfinishes, the powershell window gets stuck onSummary: 1 package finishedfor a couple of seconds before giving control back to the user.I noticed this was because of the
time.sleep(5)on Line 90 here:colcon-notification/colcon_notification/desktop_notification/win32.py
Lines 78 to 92 in 5401d06
Is there a reason to destroy the window? I commented out the line that destroys the window and the notification disappeared after a couple of seconds, and nothing seemed to go wrong.
If destroying the window is required, would it be possible to do this without having the sleep?