#!/usr/bin/env python3 import sys import time from mac_notifications import client def noop(*args, **kwargs): """No operation: do nothing.""" pass class Callback: def __init__(self): self.called_back = False def callback(self, *args, **kwargs): print(f'args: {args}') print(f'kwargs: {kwargs}') self.called_back = True if __name__ == '__main__': cb = Callback() client.create_notification( title="title", subtitle="subtitle", icon=None, action_button_str="Acknowledge", action_callback=cb.callback, ) while not cb.called_back: print('waiting...') sys.stdout.flush() time.sleep(1) print('hello!')