<s> """<STR_LIT>""" <EOL> class IPythonGrowlError ( Exception ) : <EOL> pass <EOL> class Notifier ( object ) : <EOL> def __init__ ( self , app_name ) : <EOL> try : <EOL> import Growl <EOL> except ImportError : <EOL> self . g_notifier = None <EOL> else : <EOL> self . g_notifier = Growl . GrowlNotifier ( app_name , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . g_notifier . register ( ) <EOL> def _notify ( self , title , msg ) : <EOL> if self . g_notifier is not None : <EOL> self . g_notifier . notify ( '<STR_LIT>' , title , msg ) <EOL> def notify ( self , title , msg ) : <EOL> self . _notify ( title , msg ) <EOL> def notify_deferred ( self , r , msg ) : <EOL> title = "<STR_LIT>" <EOL> msg = msg + '<STR_LIT:\n>' + repr ( r ) <EOL> self . _notify ( title , msg ) <EOL> return r <EOL> _notifier = None <EOL> def notify ( title , msg ) : <EOL> pass <EOL> def notify_deferred ( r , msg ) : <EOL> return r <EOL> def start ( app_name ) : <EOL> global _notifier , notify , notify_deferred <EOL> if _notifier is not None : <EOL> raise IPythonGrowlError ( "<STR_LIT>" ) <EOL> else : <EOL> _notifier = Notifier ( app_name ) <EOL> notify = _notifier . notify <EOL> notify_deferred = _notifier . notify_deferred </s>
