#!/usr/bin/env python from win32 import trayicon import exceptions import os import sys def with_status_GUI(worker, text_formatter): trayicon_1 = trayicon.TrayIcon(os.path.join(os.path.dirname(sys.argv[0]), "icon", "samsung_x680.ico")) try: result = worker() text = text_formatter(result) #pushed_items = push_items(cellphone_calendar_connection_1, prepare_push_items()) trayicon_1.set_balloon_text(text) # "sent %d items to the cell phone" % len(pushed_items)) trayicon_1.close() return result except exceptions.Exception, e: import traceback traceback.print_exc() trayicon_1.set_balloon_text("%s %s\n%s" % (e.__class__, str(e), traceback.format_exc()), "error") # trayicon_1.close() argh. return None