def test_notifyWithMini( self ): return notifier.mini( hostname = "127.0.0.1", password = '******', description = 'Rumble', ) # Check addresses self.CheckHandler() self.CheckHandler( index=1 ) # Check the type of notifications self.assertEqual( self.handler.messages[ 0 ].info[ 'messagetype' ], 'REGISTER' ) self.assertEqual( self.handler.messages[ 1 ].info[ 'messagetype' ], 'NOTIFY' ) # Check the notification text self.assertEqual( self.handler.messages[ 1 ].headers[ 'Notification-Text' ], 'Rumble' )
def on_error(self, status_code, data): if growl: growl.mini(u"ERROR: {0}".format(status_code)) stderr.write(colored(u"ERROR: {0}\n".format(status_code), "red")) stderr.write(colored("{0}\n\n".format(pformat(data)), "red")) if self.exit_on_error: exit(1)
def notify(self): if 0<Timer.break_time_count: mini( applicationName=GrowlName, notificationIcon=GrowlIcon, description=datetime.now().strftime(self._format), title="TimeGrowl", noteType=GrowlNotification["time"]) else: mini( applicationName=GrowlName, notificationIcon=GrowlIcon, description=datetime.now().strftime(self._format), title="TimeGrowl:Maybe take a break", noteType=GrowlNotification["time"]) Timer.break_time_count=5;
def receive_message(data, channel): ts = datetime.fromtimestamp(float(data['timestamp'])) notifier.mini(ts.strftime('%H:%M:%S: ' + data['message']))
appname = "Domino's notifier" title = "Statusupdate" current_step = 0 print("Tracking your status!") while True: request = urllib2.Request(sys.argv[1]) response = urllib2.urlopen(request) html = response.read() response.close() soup = BeautifulSoup(html) if soup.find(class_="step1-selected"): if current_step < 1: current_step = 1 mini("Aktueller Status: Bestellung aufgenommen", applicationName=appname, title=title) print("Aktueller Status: Bestellung aufgenommen") elif soup.find(class_="step2-selected"): if current_step < 2: current_step = 2 mini("Aktueller Status: Zubereitung", applicationName=appname, title=title) print("Aktueller Status: Zubereitung") elif soup.find(class_="step3-selected"): if current_step < 3: current_step = 3 mini("Aktueller Status: Backen", applicationName=appname, title=title) print("Aktueller Status: Backen") elif soup.find(class_="step4-selected"): if current_step < 4: current_step = 4 mini("Aktueller Status: Qualitaetskontrolle", applicationName=appname, title=title)
def main(): print mini('Hello world', port=9090)
def notify(self, data): if growl: growl.mini(u"{0}:\n{1}".format( data['user']['screen_name'], data['text'] ))
environ['TWITTER_OAUTH_TOKEN_SECRET'], output=output, exit_on_error=True ) stream.statuses.filter(track=keywords) if __name__ == "__main__": if len(argv) != 3: stderr.write( colored("\nUSAGE: <search-terms> <path-to-file>\n\n", "red") ) exit(1) try: search_terms = argv[1] output_file = argv[2] stdout.write( colored("\nSearching for: {0}\n\n".format(search_terms), "yellow") ) filter(search_terms, output_file) # run the streaming filter except Exception as e: if growl: growl.mini("Twitter Filter Failed!") stderr.write(colored("\n\n{0}\n".format(e), "red")) stderr.write(colored("\n{0}\n".format("-" * 40), "red")) print_exc(file=stderr) stderr.write(colored("\n{0}\n".format("-" * 40), "red")) raise e