def getData(): title = ip.inputData("Title","Enter the title") if title == "": return msg = ip.inputData("Message","Enter the message for notification") if msg == "": return minutes = ip.getMinutes(10) if minutes == "": return pb = ip.getPB() #IN LIST app.DICTIONARY["Custom"].append({"Title":title , "Message":msg , "Interval":minutes*10 , "Counter":minutes*10 , "PB":pb}) op.popUp("Notification Set","For title \"{}\" and message \"{}\" every {} minute(s)".format(title,msg,minutes),0)
def main(): global PBon global PBobj PB="" thread = Thread(target = op.thread_func, args = (t_stop,)) thread.start() while True: options = ["Choose one of the following"] options.append("Cricket Scores") options.append("Coding Contest Updates") options.append("Tweets") options.append("Custom Notification with user defined frequency") options.append("Remove any set notification") if(PB == ""): options.append("Want Notifications on Your PushBullet Devices? Enter Access Token here.") PBon = 0 else: options.append("PushBullet Device Set Up Successfully. Want to remove the Access Token?") PBon = 1 options.append("Quit") try: optionChosen = ip.getUserInput(options) except KeyboardInterrupt: exitApp() if optionChosen == len(options)-1: exitApp() if(optionChosen == len(options) -2): if(PB == ""): PB=ip.inputData("PushBullet","Enter Valid Access Token") if PB != "": try: PBobj=Pushbullet(PB) PBon = 1 op.popUp("Notify","Successfull Setup",1) except Exception as e: op.popUp("PushBullet","Wrong Access Token or Network Error\nTry Again",0) PB="" else: op.success() PB="" continue if(optionChosen == 1): cricket.main() if(optionChosen == 2): coding.main() if(optionChosen == 3): tweet.main() if(optionChosen == 4): custom.getData() if(optionChosen == 5): remove.main()
def getData(): hashtag = ip.inputData("Hashtag","Enter the hashtag") if hashtag == "": return minutes = ip.getMinutes(1) if minutes == "": main() return pb = ip.getPB() #IN LIST app.DICTIONARY["Tweets"].append({"HashTag":hashtag , "Interval":minutes*10 , "Counter":minutes*10 ,"PB":pb}) op.popUp("Notification Set","Tweets for \"{}\" every {} minute(s)".format(hashtag,minutes),0)