def run(self): tasks = gettasks(self.category) if not tasks: return mac_say.say("у вас есть задачи на сегодня", background=True) for task in tasks: title = "TODO: %s" % task.name message = "" # image = task.image image = None growlnotify.notify(t=title, m=message, image=image)
def growlnotify(self, **kwargs): if "a" not in kwargs and "image" not in kwargs: module = sys.modules[self.__class__.__module__] path = os.path.abspath(module.__file__) """ path/to/name.app/Contents/MacOS/run.py growlnotify -a path/to/name.app """ kwargs["a"] = dirname(dirname(dirname(path))) # todo: -t title (app name or cbundledisplaname) growlnotify.notify(**kwargs)
def run(self): if "accepting" not in os.popen("pg_isready").read(): return tasks = self.tasks() if not tasks: return mac_say.say("у вас есть задачи на сегодня", background=True) for task in tasks: title = "TODO: %s" % task.name f = task.path message = open(f).read() if os.path.exists(f) else "" growlnotify.notify(t=title, m=message, i=f)
def main(arduinoPort,arduinoSpeed,arguments=None): # open up the serial port ser = serial.Serial(arduinoPort, arduinoSpeed) # watch out for the right characters while 1: val = ser.readline() #print(repr(val)[1:-1]) # print out the invisible characters (handy for debugging) # if we get a 'd' from the arduino, a button was pressed if (val == 'd\r\n'): # deploy! print 'Preparing to deploy!' os.system('git commit -am "this was deployed by an Arduino!"') os.system('git push heroku master') if notify: notify('Heroku Deployer','Code deployed to Heroku!') # wait a bit... time.sleep(5) # hang out for five seconds print 'All good!'
#!/usr/bin/env python # -*- coding: utf-8 -*- import growlnotify growlnotify.notify(t="title")
#!/usr/bin/env python # -*- coding: utf-8 -*- import growlnotify growlnotify.notify(t="title", m="message") growlnotify.notify(t="title2", message="message2")
def growlnotify(self): t = "Температура %s °" % self.t m = "Норма 18-25" growlnotify.notify(t=t, m=m, image=self.image)
#!/usr/bin/env python # -*- coding: utf-8 -*- import growlnotify growlnotify.notify(t="s", s=True) growlnotify.notify(t="sticky", sticky=True)
def growlnotify(self): growlnotify.notify(t=NOW.strftime('%H:%M'), image="time.png")