def lbox(self): ind=self.lb.current() if ind==2: a=ui.selection_list([u'Static', u'Dynamic']) if a==0: static() elif a==1: dynamic() elif ind==0: tnu=self.tnu tcp=self.tcp cgpa=self.cgpa() ui.query(u'TCP :> '+tcp.strip()+'\nTNU :> '+tnu+'\n\nCGPA :> '+cgpa, 'query', None, u'OK', u'Back') else: new=static(int(self.tnu), float(self.tcp)) if not new: return 0 if type(new)!=list: ui.note(u'an error occurred', 'error') return 0 a=open(folder+'%s.gpd'%self.user, 'w') a.write(str(new[1])+'\n') a.write(str(new[0])) a.close() self.update(self.user)
def send_msg(): txt = appuifw2.app.body.get() opt=globalui.global_popup_menu([u'From Contacts',u'Enter Manually'],u'Choose Number') if opt==1: num = appuifw2.query(u'Type the Number', 'float') try: num=int(num) except: return None elif opt==0: nam=appuifw2.query(u'Type the Name','text') con=contacts.ContactsDb() ls=con.find(nam) lst=[] try: for i in ls: lst.append(i.title) lst.sort() se=appuifw2.selection_list(lst,True) num=ls[se][0].value except: return None try: if num==None: return None else: pro = sysinfo.active_profile() if pro == 'offline' : globalui.global_note(u'Phone in Offline profile! Message will be sent later.', 'warn') else: net = sysinfo.signal_bars() if net == 0 : globalui.global_note(u'No signal! Message will be sent later.', 'warn') pass m=messaging.sms_send(num, txt) globalui.global_note(u'Message Submitted succesfully', 'confirm') except: return None