def create_circle(N): """ CLL Creation """ response = unit_test(N) if response == False: print bcolors.FAIL + "Exiting" return False current = 2 first_person = people() first_person.location =1 first_person.next_person=None latest_added = first_person while current <=N : new_person = people() new_person.location = latest_added.location+1 new_person.next_person=None latest_added.next_person=new_person latest_added=new_person current=current+1 latest_added.next_person=first_person give_sword_to(initial_sword_given_to,first_person,N)
def main(): dogs = [] peoples = [] for i in range(2): person = people() peoples.append(person) for i in range(3): dog1 = dog() dogs.append(dog1) # print(random.choice(peoples)) while len(peoples) != 0 and len(dogs) != 0: person = random.choice(peoples) if person.life: dog1 = random.choice(dogs) if dog1.life: person.hit(dog1) dog1.bit(person) else: dogs.remove(dog1) else: peoples.remove(person) else: if len(peoples) != 0: print('人赢了') else: print('狗赢了')
def body(self): self.people = people() self.elements = {} self.elements["idLabel"] = Label(self.rootFrame, text="MUID: " + self.person["IDNumber"]) self.elements["idLabel"].grid(row=0, column=0, columnspan=2) self.elements["nameLabel"] = Label(self.rootFrame, text="Name: ") self.elements["nameLabel"].grid(row=1, column=0) self.elements["nameEntry"] = Entry(self.rootFrame) self.elements["nameEntry"].insert(0, self.person["name"]) self.elements["nameEntry"].grid(row=1, column=1) self.elements["roomLabel"] = Label(self.rootFrame, text="Room: ") self.elements["roomLabel"].grid(row=2, column=0) self.elements["roomEntry"] = Entry(self.rootFrame) self.elements["roomEntry"].insert(0, self.person["room"]) self.elements["roomEntry"].grid(row=2, column=1) self.elements["phoneLabel"] = Label(self.rootFrame, text="Phone: ") self.elements["phoneLabel"].grid(row=3, column=0) self.elements["phoneEntry"] = Entry(self.rootFrame) self.elements["phoneEntry"].insert(0, self.person["phoneNumber"]) self.elements["phoneEntry"].grid(row=3, column=1) self.elements["emailLabel"] = Label(self.rootFrame, text="Email: ") self.elements["emailLabel"].grid(row=4, column=0) self.elements["emailEntry"] = Entry(self.rootFrame) self.elements["emailEntry"].grid(row=4, column=1) self.elements["emailEntry"].insert(0, self.person["email"]) self.elements["buttonChange"] = Button(self.rootFrame, text="Apply Changes", command=self.applyChanges_call) self.elements["buttonChange"].grid(row=10, column=0, columnspan=2)
class fight(): d = dog() p = people() def __init__(self): i = random.randint(0, 2) for i in range(i, 100): time.sleep(0.5) if not self.p.fail(): print("dog胜利") break elif not self.d.fail(): print("people胜利") break elif i % 2 == 1: m, m1 = self.d.attack() x, x1 = self.p.behit(m1) print("{}攻击了{}".format(m, x1)) print("{}攻击下降2,生命下降{}".format(x1, m1)) print(self.p.list1[x]) if self.p.list1[x]["blo"] == 0: print("{}被杀死".format(self.p.list1[x]["name"])) elif i % 2 == 0: m, m1 = self.p.attack() x, x1 = self.d.behit(m1) print("{}攻击了{}".format(m, x1)) print("{}攻击下降3,生命下降{}".format(x1, m1)) print(self.d.list1[x]) if self.d.list1[x]["blo"] == 0: print("{}被杀死".format(self.d.list1[x]["name"]))
def sample(): p=people.people('张三',23) res={"code": 1, 'data':''} pe=people.peopleex() pe.p=p pe.ex="hellp" res['data']=pe return json.dumps(res,default=obj2dict)
def applyChanges(self,ignore=""): self.person['name']=self.elements['nameEntry'].get() self.person['IDNumber']=self.elements['idNumberEntry'].get() self.person['room']=self.elements['roomEntry'].get() self.person['phoneNumber']=self.elements['phoneEntry'].get() self.person['email']=self.elements['emailEntry'].get() self.person['premiumStatus']=self.elements['premiumEntry'].state.get() self.people=people() self.people.modify_person(self.person) self.destroy()
def applyChanges(self, ignore=""): self.person['name'] = self.elements['nameEntry'].get() self.person['IDNumber'] = self.elements['idNumberEntry'].get() self.person['room'] = self.elements['roomEntry'].get() self.person['phoneNumber'] = self.elements['phoneEntry'].get() self.person['email'] = self.elements['emailEntry'].get() self.person['premiumStatus'] = self.elements['premiumEntry'].state.get( ) self.people = people() self.people.modify_person(self.person) self.destroy()
def body(self): #makes the elements of the body and binds them to things #tried to keep the columns togeather and goes from top to bottom self.elements = {} self.elements["personList"] = Listbox(self) self.elements["personList"].grid(row=0, column=0, rowspan=12, sticky=N + S + W + E) self.elements["personList"].focus_set() self.elements["personList"].bind("<Button-1>", self.displayPerson_call) self.elements["nameLabel"] = Label(self, text="Student Name") self.elements["nameLabel"].grid(row=0, column=2) self.elements["muidLabel"] = Label(self, text="Student Number") self.elements["muidLabel"].grid(row=1, column=2) self.elements["roomLabel"] = Label(self, text="Room") self.elements["roomLabel"].grid(row=2, column=2) self.elements["itemsLabel"] = Label(self, text="Items:\nLine 1\nLine2") self.elements["itemsLabel"].grid(row=3, column=2) self.elements["buttonAddItems"] = Button( self, text="Add/Remove Items", command=self.modifyPersonItems_call) self.elements["buttonAddItems"].grid(row=10, column=2) self.elements["buttonChangePerson"] = Button( self, text="Change Information", command=self.modifyPersonInfo_call) self.elements["buttonChangePerson"].grid(row=11, column=2) self.people = people() #auto populates the person list for x in self.people: self.elements["personList"].insert(END, x['name']) self.elements["personList"].select_set(0) self.displayPerson() #scollbar self.elements['personListScroll'] = Scrollbar( self, command=self.elements['personList'].yview) self.elements['personListScroll'].grid(row=0, column=1, rowspan=12, sticky=N + S + W) self.elements['personList'].config( yscrollcommand=self.elements['personListScroll'].set) #allows the dynamic resizing stuff to work self.rowconfigure(9, weight=1) self.columnconfigure(0, weight=1) self.columnconfigure(2, weight=1) self.bind("<Configure>", self.dynamicResizing)
def press(self): signal = GPIO.input(self.GPIOID) if signal: print 1 if signal: self.history = signal P = subprocess.Popen('./script.sh', shell=True, stdout=subprocess.PIPE) time.sleep(2) p = people.people() con = p.compare() #相似度 if con == False: self.content = '姿势' self.up() print '请调整姿势!' elif con > 60: self.c = True self.content = '开门' self.up() print '解锁' GPIO.output(3, GPIO.HIGH) time.sleep(3) GPIO.output(3, GPIO.LOW) else: self.content = '允许' print "请获得主人允许!" elif not signal and self.c == True: self.history = signal self.c = False self.content = '关闭' self.up() print '锁住' #GPIO.output(3,GPIO.HIGH) GPIO.cleanup() GPIO.setmode(GPIO.BOARD) time.sleep(1) GPIO.setup(self.GPIOID, GPIO.IN) GPIO.setup(3, GPIO.OUT)
def body(self): #makes the elements of the body and binds them to things #tried to keep the columns togeather and goes from top to bottom self.elements={} self.elements["personList"]=Listbox(self) self.elements["personList"].grid(row=0,column=0,rowspan=12,sticky=N+S+W+E) self.elements["personList"].focus_set() self.elements["personList"].bind("<Button-1>",self.displayPerson_call) self.elements["nameLabel"]=Label(self,text="Student Name") self.elements["nameLabel"].grid(row=0,column=2) self.elements["muidLabel"]=Label(self,text="Student Number") self.elements["muidLabel"].grid(row=1,column=2) self.elements["roomLabel"]=Label(self,text="Room") self.elements["roomLabel"].grid(row=2,column=2) self.elements["itemsLabel"]=Label(self,text="Items:\nLine 1\nLine2") self.elements["itemsLabel"].grid(row=3,column=2) self.elements["buttonAddItems"]=Button(self,text="Add/Remove Items",command=self.modifyPersonItems_call) self.elements["buttonAddItems"].grid(row=10,column=2) self.elements["buttonChangePerson"]=Button(self,text="Change Information",command=self.modifyPersonInfo_call) self.elements["buttonChangePerson"].grid(row=11,column=2) self.people=people() #auto populates the person list for x in self.people: self.elements["personList"].insert(END,x['name']) self.elements["personList"].select_set(0) self.displayPerson() #scollbar self.elements['personListScroll']=Scrollbar(self,command=self.elements['personList'].yview) self.elements['personListScroll'].grid(row=0,column=1,rowspan=12,sticky=N+S+W) self.elements['personList'].config(yscrollcommand=self.elements['personListScroll'].set) #allows the dynamic resizing stuff to work self.rowconfigure(9,weight=1) self.columnconfigure(0,weight=1) self.columnconfigure(2,weight=1) self.bind("<Configure>",self.dynamicResizing)
def body(self): self.people = people() self.elements = {} self.elements["idLabel"] = Label(self.rootFrame, text="MUID: " + self.person["IDNumber"]) self.elements["idLabel"].grid(row=0, column=0, columnspan=2) self.elements["nameLabel"] = Label(self.rootFrame, text="Name: ") self.elements["nameLabel"].grid(row=1, column=0) self.elements["nameEntry"] = Entry(self.rootFrame) self.elements["nameEntry"].insert(0, self.person["name"]) self.elements["nameEntry"].grid(row=1, column=1) self.elements["roomLabel"] = Label(self.rootFrame, text="Room: ") self.elements["roomLabel"].grid(row=2, column=0) self.elements["roomEntry"] = Entry(self.rootFrame) self.elements["roomEntry"].insert(0, self.person["room"]) self.elements["roomEntry"].grid(row=2, column=1) self.elements["phoneLabel"] = Label(self.rootFrame, text="Phone: ") self.elements["phoneLabel"].grid(row=3, column=0) self.elements["phoneEntry"] = Entry(self.rootFrame) self.elements["phoneEntry"].insert(0, self.person["phoneNumber"]) self.elements["phoneEntry"].grid(row=3, column=1) self.elements["emailLabel"] = Label(self.rootFrame, text="Email: ") self.elements["emailLabel"].grid(row=4, column=0) self.elements["emailEntry"] = Entry(self.rootFrame) self.elements["emailEntry"].grid(row=4, column=1) self.elements["emailEntry"].insert(0, self.person['email']) self.elements["buttonChange"] = Button(self.rootFrame, text='Apply Changes', command=self.applyChanges_call) self.elements["buttonChange"].grid(row=10, column=0, columnspan=2)
# start capturing the live stream from webcam/deeplens video_capture = cv2.VideoCapture(0) while True: # try and except to handle the broken pipe with the server try: # creating connection with the server ws = websocket.create_connection("ws://gitex.ahla.io:5555") while True: # getting the captured frame ret, frame = video_capture.read() # resizing the frame small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) # converting the resized frame to rgb rgb_small_frame = small_frame[:, :, ::-1] # creating an instance from the people blueprint person = people.people() # Find all the faces and face encodings in the current frame of video face_locations = face_recognition.face_locations(rgb_small_frame) # getting encodings from the captured faces face_encodings = face_recognition.face_encodings( rgb_small_frame, face_locations) # check if there's a face before starting the emotion and facial recognition if not face_locations == []: # creating a thread for the face recognition facial_recognition = ThreadWithReturnValue( target=face_rec.personRecognition, args=(face_encodings, known_people_encodings, known_people_name, small_frame, rgb_small_frame)) # starting the face recognition thread facial_recognition.start() # starting the emotion recognition / Now both the emotion and face recognition working together
def body(self): self.elements = {} print self.item self.elements['nameLabel'] = Label(self.rootFrame, text=self.item['name']) self.elements['nameLabel'].grid(row=0, column=0, columnspan=2) self.elements['usedLabel'] = Label(self.rootFrame, text="Checked Out: " + self.item['used']) self.elements['usedLabel'].grid(row=1, column=0, columnspan=2) self.elements['quantityLabel'] = Label(self.rootFrame, text="Total Avail: ") self.elements['quantityLabel'].grid(row=2, column=0, sticky=W) self.elements['quantityEntry'] = Entry(self.rootFrame) self.elements['quantityEntry'].grid(row=2, column=1, sticky=W + E) self.elements['quantityEntry'].insert(0, self.item['quantity']) self.elements['daysAllowedLabel'] = Label(self.rootFrame, text="Days: ") self.elements['daysAllowedLabel'].grid(row=3, column=0, sticky=W) self.elements['daysAllowedEntry'] = Entry(self.rootFrame) self.elements['daysAllowedEntry'].grid(row=3, column=1, sticky=W + E) self.elements['daysAllowedEntry'].insert(0, self.item['daysAllowed']) self.elements['hoursAllowedLabel'] = Label(self.rootFrame, text="Hours: ") self.elements['hoursAllowedLabel'].grid(row=4, column=0, sticky=W) self.elements['hoursAllowedEntry'] = Entry(self.rootFrame) self.elements['hoursAllowedEntry'].grid(row=4, column=1, sticky=W + E) self.elements['hoursAllowedEntry'].insert(0, self.item['hoursAllowed']) self.elements['priceLabel'] = Label(self.rootFrame, text="Price: ") self.elements['priceLabel'].grid(row=5, column=0, sticky=W) self.elements['priceEntry'] = Entry(self.rootFrame) self.elements['priceEntry'].grid(row=5, column=1, sticky=W + E) self.elements['priceEntry'].insert(0, self.item['price']) self.elements['premiumLabel'] = Label(self.rootFrame, text="Premium Item: ") self.elements['premiumLabel'].grid(row=6, column=0, sticky=W) temp = StringVar() self.elements['premiumEntry'] = Checkbutton(self.rootFrame, text="", variable=temp, onvalue='1', offvalue='0') self.elements['premiumEntry'].grid(row=6, column=1, sticky=W) self.elements['premiumEntry'].state = temp if self.item['premiumStatus'] == '1': self.elements['premiumEntry'].select() else: self.elements['premiumEntry'].deselect() self.elements['tagsLabel'] = Label(self.rootFrame, text="Tags: ") self.elements['tagsLabel'].grid(row=7, column=0, sticky=W) self.elements['tagsEntry'] = Entry(self.rootFrame) self.elements['tagsEntry'].grid(row=7, column=1, sticky=E + W) self.elements["tagsEntry"].insert(0, self.item['tags']) self.elements['imageLabel'] = Label(self.rootFrame) self.elements['imageLabel'].grid(row=1, column=3, rowspan=7, columnspan=2) self.updateImage() self.elements['imageImportButton'] = Button(self.rootFrame, text="Import Image", command=self.importImage) self.elements['imageImportButton'].grid(row=9, column=4) self.elements['peopleList'] = Listbox(self.rootFrame) self.elements['peopleList'].grid(row=0, column=5, rowspan=10, sticky=N + S) self.elements['applyButton'] = Button(self.rootFrame, text=" APPLY ", command=self.applyChanges) self.elements['applyButton'].grid(row=10, column=0, columnspan=2, sticky=E + W + N + S) self.people = people() for person in self.people: for item in person['items']: if self.item['name'] == item[0]: self.elements['peopleList'].insert( END, person['name'] + ' - ' + person['IDNumber']) break
def body(self): self.elements={} print self.item self.elements['nameLabel']=Label(self.rootFrame,text=self.item['name']) self.elements['nameLabel'].grid(row=0,column=0,columnspan=2) self.elements['usedLabel']=Label(self.rootFrame,text="Checked Out: "+self.item['used']) self.elements['usedLabel'].grid(row=1,column=0,columnspan=2) self.elements['quantityLabel']=Label(self.rootFrame,text="Total Avail: ") self.elements['quantityLabel'].grid(row=2,column=0,sticky=W) self.elements['quantityEntry']=Entry(self.rootFrame) self.elements['quantityEntry'].grid(row=2,column=1,sticky=W+E) self.elements['quantityEntry'].insert(0,self.item['quantity']) self.elements['daysAllowedLabel']=Label(self.rootFrame,text="Days: ") self.elements['daysAllowedLabel'].grid(row=3,column=0,sticky=W) self.elements['daysAllowedEntry']=Entry(self.rootFrame) self.elements['daysAllowedEntry'].grid(row=3,column=1,sticky=W+E) self.elements['daysAllowedEntry'].insert(0,self.item['daysAllowed']) self.elements['hoursAllowedLabel']=Label(self.rootFrame,text="Hours: ") self.elements['hoursAllowedLabel'].grid(row=4,column=0,sticky=W) self.elements['hoursAllowedEntry']=Entry(self.rootFrame) self.elements['hoursAllowedEntry'].grid(row=4,column=1,sticky=W+E) self.elements['hoursAllowedEntry'].insert(0,self.item['hoursAllowed']) self.elements['priceLabel']=Label(self.rootFrame,text="Price: ") self.elements['priceLabel'].grid(row=5,column=0,sticky=W) self.elements['priceEntry']=Entry(self.rootFrame) self.elements['priceEntry'].grid(row=5,column=1,sticky=W+E) self.elements['priceEntry'].insert(0,self.item['price']) self.elements['premiumLabel']=Label(self.rootFrame,text="Premium Item: ") self.elements['premiumLabel'].grid(row=6,column=0,sticky=W) temp=StringVar() self.elements['premiumEntry']=Checkbutton(self.rootFrame,text="",variable=temp,onvalue='1',offvalue='0') self.elements['premiumEntry'].grid(row=6,column=1,sticky=W) self.elements['premiumEntry'].state=temp if self.item['premiumStatus']=='1':self.elements['premiumEntry'].select() else:self.elements['premiumEntry'].deselect() self.elements['tagsLabel']=Label(self.rootFrame,text="Tags: ") self.elements['tagsLabel'].grid(row=7,column=0,sticky=W) self.elements['tagsEntry']=Entry(self.rootFrame) self.elements['tagsEntry'].grid(row=7,column=1,sticky=E+W) self.elements["tagsEntry"].insert(0,self.item['tags']) self.elements['imageLabel']=Label(self.rootFrame) self.elements['imageLabel'].grid(row=1,column=3,rowspan=7,columnspan=2) self.updateImage() self.elements['imageImportButton']=Button(self.rootFrame,text="Import Image",command=self.importImage) self.elements['imageImportButton'].grid(row=9,column=4) self.elements['peopleList']=Listbox(self.rootFrame) self.elements['peopleList'].grid(row=0,column=5,rowspan=10,sticky=N+S) self.elements['applyButton']=Button(self.rootFrame,text=" APPLY ",command=self.applyChanges) self.elements['applyButton'].grid(row=10,column=0,columnspan=2,sticky=E+W+N+S) self.people=people() for person in self.people: for item in person['items']: if self.item['name']==item[0]: self.elements['peopleList'].insert(END,person['name']+' - '+person['IDNumber']) break
def body(self): self.elements = {} self.elements["searchEntry"] = Entry(self.rootFrame) self.elements['searchEntry'].grid(row=0, column=0) self.elements['searchEntry'].bind("<Key>", self.searchItems_call) #ITEMS ADMIN AREA self.elements['itemsList'] = Listbox(self.rootFrame) self.elements['itemsList'].grid(row=1, column=0, rowspan=900, sticky=N + S + W) self.elements['itemsList'].bind("<Button-1>", self.displayInfoItem_call) self.elements['itemInfoName'] = Label(self.rootFrame, text="Item Name") self.elements["itemInfoName"].grid(row=1, column=2) self.elements["itemInfoQuantityUsed"] = Label(self.rootFrame, text="Number Used: 0") self.elements["itemInfoQuantityUsed"].grid(row=2, column=2) self.elements["itemInfoQuantityTotal"] = Label( self.rootFrame, text="Total: OVER 9000!!!") self.elements["itemInfoQuantityTotal"].grid(row=3, column=2) self.elements["itemInfoTags"] = Label(self.rootFrame, text="Tags:\nTag1 Tag2 Tag3") self.elements["itemInfoTags"].grid(row=4, column=2) self.elements["itemInfoDaysAllowed"] = Label(self.rootFrame, text="Days Allowed: 555") self.elements["itemInfoDaysAllowed"].grid(row=5, column=2) self.elements["itemInfoPicture"] = Label(self.rootFrame, text="PICTURE WILL GO HERE") self.elements["itemInfoPicture"].grid(row=6, column=2, columnspan=2) self.elements['modifyItemButton'] = Button( self.rootFrame, text="Modify Item", command=self.modifyItem_call) self.elements['modifyItemButton'].grid(row=1, column=3, rowspan=2, sticky=E) self.elements['removeItemButton'] = Button( self.rootFrame, text="Remove Item", command=self.removeItem_call) self.elements['removeItemButton'].grid(row=3, column=3, rowspan=2, sticky=E) self.elements["addItemButton"] = Button(self.rootFrame, text="Add Items", command=self.addItem_call) self.elements['addItemButton'].grid(row=5, column=3, sticky=E) self.itemImage = ImageTk.PhotoImage(file="Image-not-found.gif") self.elements["itemInfoPicture"].config(image=self.itemImage) #PERSON ADMIN AREA self.elements["peopleList"] = Listbox(self.rootFrame) self.elements['peopleList'].grid(row=1000, column=0, rowspan=999, sticky=N + S + W) #yes i mean row=1000 self.elements['peopleList'].bind("<Button-1>", self.displayPersonInfo_call) self.elements['personInfoName'] = Label(self.rootFrame, text="Name Goes Here") self.elements['personInfoName'].grid(row=1000, column=2) self.elements['personInfoRoom'] = Label(self.rootFrame, text="Room: Here") self.elements['personInfoRoom'].grid(row=1001, column=2) self.elements['personInfoIdNumber'] = Label(self.rootFrame, text="IDNumber: Here") self.elements['personInfoIdNumber'].grid(row=1002, column=2) self.elements['personInfoPhone'] = Label(self.rootFrame, text="PHONE NUMBER HERE") self.elements['personInfoPhone'].grid(row=1003, column=2) self.elements['personInfoEmail'] = Label(self.rootFrame, text="Email Here") self.elements['personInfoEmail'].grid(row=1004, column=2) self.elements['modifyPersonButton'] = Button( self.rootFrame, text="Modify Person", command=self.modifyPerson_call) self.elements['modifyPersonButton'].grid(row=1000, column=3, sticky=E, rowspan=2) self.elements['removePersonButton'] = Button( self.rootFrame, text="Remove Person", command=self.removePerson_call) self.elements['removePersonButton'].grid(row=1002, column=3, sticky=E, rowspan=2) self.elements['addPersonButton'] = Button(self.rootFrame, text="Add Person", command=self.addPerson_call) self.elements['addPersonButton'].grid(row=1004, column=3, rowspan=2, sticky=E) #initialize the lists self.items = items() self.searchedItems = [] for x in self.items: self.searchedItems.append(x) self.people = people() self.searchedPeople = [] for x in self.people: self.searchedPeople.append(x) self.redrawLists() #scrollbars self.elements['peopleListScroll'] = Scrollbar( self.rootFrame, command=self.elements['peopleList'].yview) self.elements['peopleListScroll'].grid(row=1000, column=1, rowspan=999, sticky=N + S + W) self.elements['peopleList'].config( yscrollcommand=self.elements['peopleListScroll'].set) self.elements['itemsListScroll'] = Scrollbar( self.rootFrame, command=self.elements['itemsList'].yview) self.elements['itemsListScroll'].grid(row=1, column=1, rowspan=900, sticky=N + S + W) self.elements['itemsList'].config( yscrollcommand=self.elements['itemsListScroll'].set)
import people; p = people.people() people.sayHello(p);
import nationaltech import xinlang import technews import techworld import people import tech import combile if __name__ == '__main__': nationaltech.nationaltech() print("11111111111111") xinlang.xinlang() print("2222222222222") tech.tech() print("3333333333333") techworld.techword() print("4444444444444") technews.technews() print("55555555555555") people.people() print("66666666666666") combile.acombile() print("77777777777777")
def runpeople(self): self.root.destroy() h3 = people.people()
from people import people from people import bossenemy from globalvariables import globalvariables from colorama import init, Fore, Back, Style import objects import os import time init() # from people import people/ x = board() x._createboard(x) gvariables = globalvariables() benemy = bossenemy() #x.print() jetpack = people() now = time.time() shieldtimestart = int(time.time()) - 20 while True: later = time.time() diff = int(later - now) if (int(later - shieldtimestart) == 10): gvariables._getoffshield() if (int(later - shieldtimestart) == 70): gvariables._activateshieldactive() gvariables._calremainingtime(diff) # PRINTING jetpack._check(x, gvariables) for i in range(35): for j in range(gvariables._getk(), gvariables._getk() + 148): x._display[i][j - gvariables._getk()] = x._getmatrixvalue(i, j)
def body(self): self.elements = {} self.elements['idNumberLabel'] = Label(self.rootFrame, text="ID Number: " + self.person['IDNumber']) self.elements['idNumberLabel'].grid(row=0, column=0, columnspan=2) self.elements['nameLabel'] = Label(self.rootFrame, text="Name: ") self.elements['nameLabel'].grid(row=1, column=0, sticky=W) self.elements['nameEntry'] = Entry(self.rootFrame) self.elements['nameEntry'].grid(row=1, column=1, sticky=E + W) self.elements['nameEntry'].insert(0, self.person['name']) self.elements['roomLabel'] = Label(self.rootFrame, text="Room: ") self.elements['roomLabel'].grid(row=2, column=0, sticky=W) self.elements['roomEntry'] = Entry(self.rootFrame) self.elements['roomEntry'].grid(row=2, column=1, sticky=E + W) self.elements['roomEntry'].insert(0, self.person['room']) self.elements['phoneLabel'] = Label(self.rootFrame, text="Phone: ") self.elements['phoneLabel'].grid(row=3, column=0, sticky=W) self.elements['phoneEntry'] = Entry(self.rootFrame) self.elements['phoneEntry'].grid(row=3, column=1, sticky=E + W) self.elements['phoneEntry'].insert(0, self.person['phoneNumber']) self.elements['emailLabel'] = Label(self.rootFrame, text="E-Mail: ") self.elements['emailLabel'].grid(row=4, column=0, sticky=W) self.elements['emailEntry'] = Entry(self.rootFrame) self.elements['emailEntry'].grid(row=4, column=1, sticky=E + W) self.elements['emailEntry'].insert(0, self.person['email']) self.elements['premiumLabel'] = Label(self.rootFrame, text="Premium Status: ") self.elements['premiumLabel'].grid(row=5, column=0, sticky=W) temp = StringVar() self.elements['premiumEntry'] = Checkbutton(self.rootFrame, text="", variable=temp, onvalue='1', offvalue='0') self.elements['premiumEntry'].grid(row=5, column=1, sticky=W) self.elements['premiumEntry'].state = temp if self.person['premiumStatus'] == '1': self.elements['premiumEntry'].select() else: self.elements['premiumEntry'].deselect() self.elements['currentItemsLabel'] = Label(self.rootFrame, text="Checked Out") self.elements['currentItemsLabel'].grid(row=0, column=2) self.elements['currentItems'] = Listbox(self.rootFrame) self.elements["currentItems"].grid(row=1, column=2, rowspan=8, sticky=N + S) self.elements["currentItems"].bind("<Button-1>", self.displayItem_call) self.elements["currentItems"].bind("<Key>", self.displayItem_call) self.elements['pastItemsLabel'] = Label(self.rootFrame, text="Past Items") self.elements['pastItemsLabel'].grid(row=0, column=4) self.elements['pastItems'] = Listbox(self.rootFrame) self.elements['pastItems'].grid(row=1, column=4, rowspan=8, sticky=N + S) self.elements["pastItems"].bind("<Button-1>", self.displayItem_call) self.elements["pastItems"].bind("<Key>", self.displayItem_call) self.elements['applyButton'] = Button(self.rootFrame, text=" APPLY ", command=self.applyChanges) self.elements['applyButton'].grid(row=10, column=0, columnspan=2) self.people = people() self.items = items() for x in self.people.dueItems(self.person): self.elements['currentItems'].insert(END, x[0]) if self.people.isOverdue(x): self.elements['currentItems'].itemconfig(END, bg='red') for x in self.people.pastItems(self.person): self.elements['pastItems'].insert(END, x[0]) self.elements['itemInfoDate'] = Label(self.rootFrame, text="Date: HERE!") self.elements['itemInfoDate'].grid(row=10, column=2) self.elements['itemInfoPrice'] = Label(self.rootFrame, text="Price: HERE!") self.elements['itemInfoPrice'].grid(row=10, column=4) #scrollbars self.elements['currentItemsScroll'] = Scrollbar( self.rootFrame, command=self.elements['currentItems'].yview) self.elements['currentItemsScroll'].grid(row=1, column=3, rowspan=8, sticky=N + S + W) self.elements['currentItems'].config( yscrollcommand=self.elements['currentItemsScroll'].set) self.elements['pastItemsScroll'] = Scrollbar( self.rootFrame, command=self.elements['pastItems'].yview) self.elements['pastItemsScroll'].grid(row=1, column=5, rowspan=8, sticky=N + S + W) self.elements['pastItems'].config( yscrollcommand=self.elements['pastItemsScroll'].set)
def checkForOverdue(ignore=""): ppp=people() ppp.emailPeopleOverdue() #repeat the timed check root.after(1000*60*5,checkForOverdue) #1000ms*60s*5mins so basicly every 5 mins check for overdue items
def body(self): self.elements={} self.elements['idNumberLabel']=Label(self.rootFrame,text="ID Number: "+self.person['IDNumber']) self.elements['idNumberLabel'].grid(row=0,column=0,columnspan=2) self.elements['nameLabel']=Label(self.rootFrame,text="Name: ") self.elements['nameLabel'].grid(row=1,column=0,sticky=W) self.elements['nameEntry']=Entry(self.rootFrame) self.elements['nameEntry'].grid(row=1,column=1,sticky=E+W) self.elements['nameEntry'].insert(0,self.person['name']) self.elements['roomLabel']=Label(self.rootFrame,text="Room: ") self.elements['roomLabel'].grid(row=2,column=0,sticky=W) self.elements['roomEntry']=Entry(self.rootFrame) self.elements['roomEntry'].grid(row=2,column=1,sticky=E+W) self.elements['roomEntry'].insert(0,self.person['room']) self.elements['phoneLabel']=Label(self.rootFrame,text="Phone: ") self.elements['phoneLabel'].grid(row=3,column=0,sticky=W) self.elements['phoneEntry']=Entry(self.rootFrame) self.elements['phoneEntry'].grid(row=3,column=1,sticky=E+W) self.elements['phoneEntry'].insert(0,self.person['phoneNumber']) self.elements['emailLabel']=Label(self.rootFrame,text="E-Mail: ") self.elements['emailLabel'].grid(row=4,column=0,sticky=W) self.elements['emailEntry']=Entry(self.rootFrame) self.elements['emailEntry'].grid(row=4,column=1,sticky=E+W) self.elements['emailEntry'].insert(0,self.person['email']) self.elements['premiumLabel']=Label(self.rootFrame,text="Premium Status: ") self.elements['premiumLabel'].grid(row=5,column=0,sticky=W) temp=StringVar() self.elements['premiumEntry']=Checkbutton(self.rootFrame,text="",variable=temp,onvalue='1',offvalue='0') self.elements['premiumEntry'].grid(row=5,column=1,sticky=W) self.elements['premiumEntry'].state=temp if self.person['premiumStatus']=='1':self.elements['premiumEntry'].select() else:self.elements['premiumEntry'].deselect() self.elements['currentItemsLabel']=Label(self.rootFrame,text="Checked Out") self.elements['currentItemsLabel'].grid(row=0,column=2) self.elements['currentItems']=Listbox(self.rootFrame) self.elements["currentItems"].grid(row=1,column=2,rowspan=8,sticky=N+S) self.elements["currentItems"].bind("<Button-1>",self.displayItem_call) self.elements["currentItems"].bind("<Key>",self.displayItem_call) self.elements['pastItemsLabel']=Label(self.rootFrame,text="Past Items") self.elements['pastItemsLabel'].grid(row=0,column=4) self.elements['pastItems']=Listbox(self.rootFrame) self.elements['pastItems'].grid(row=1,column=4,rowspan=8,sticky=N+S) self.elements["pastItems"].bind("<Button-1>",self.displayItem_call) self.elements["pastItems"].bind("<Key>",self.displayItem_call) self.elements['applyButton']=Button(self.rootFrame,text=" APPLY ",command=self.applyChanges) self.elements['applyButton'].grid(row=10,column=0,columnspan=2) self.people=people() self.items=items() for x in self.people.dueItems(self.person): self.elements['currentItems'].insert(END,x[0]) if self.people.isOverdue(x): self.elements['currentItems'].itemconfig(END,bg='red') for x in self.people.pastItems(self.person): self.elements['pastItems'].insert(END,x[0]) self.elements['itemInfoDate']=Label(self.rootFrame,text="Date: HERE!") self.elements['itemInfoDate'].grid(row=10,column=2) self.elements['itemInfoPrice']=Label(self.rootFrame,text="Price: HERE!") self.elements['itemInfoPrice'].grid(row=10,column=4) #scrollbars self.elements['currentItemsScroll']=Scrollbar(self.rootFrame,command=self.elements['currentItems'].yview) self.elements['currentItemsScroll'].grid(row=1,column=3,rowspan=8,sticky=N+S+W) self.elements['currentItems'].config(yscrollcommand=self.elements['currentItemsScroll'].set) self.elements['pastItemsScroll']=Scrollbar(self.rootFrame,command=self.elements['pastItems'].yview) self.elements['pastItemsScroll'].grid(row=1,column=5,rowspan=8,sticky=N+S+W) self.elements['pastItems'].config(yscrollcommand=self.elements['pastItemsScroll'].set)
def clickopen(self): self.dialog = people.people(self) self.dialog.exec()
members = groupObj.getMembers() grpLocation = groupObj.getLocation() if grpLocation != None: groupAddress = grpLocation["data"]["attributes"]["full_formatted_address"].replace("\n", ", ") groupLong = grpLocation["data"]["attributes"]["longitude"] groupLat = grpLocation["data"]["attributes"]["latitude"] else: groupAddress = "" groupLong = "" groupLat = "" for member in members["data"]: # try: print(" %s %s" % (member["attributes"]["first_name"], member["attributes"]["last_name"])) time.sleep(.2) # a little more slow down personObj = people(member["attributes"]["account_center_identifier"]) person = personObj.getPerson() maritalStatus = personObj.getMaritalStatus() addresses = personObj.getAddress() if addresses != None and len(addresses["data"]) > 0: address = addresses["data"][0] mapApi = maps("%s %s %s" % (address["attributes"]["city"] if address["attributes"]["city"] != None else '', address["attributes"]["state"] if address["attributes"]["state"] != None else '', address["attributes"]["zip"] if address["attributes"]["zip"] != None else '')) mapLocation = mapApi.getLocation() if grpLocation != None: distanceUnit = config.UNIT if hasattr(config, 'UNIT') else 'miles' memberDistance = eval('distance.distance((groupLat, groupLong),(mapLocation["lat"], mapLocation["lng"])).' + distanceUnit) else: memberDistance = ""
def body(self): self.elements={} self.elements["searchEntry"]=Entry(self.rootFrame) self.elements['searchEntry'].grid(row=0,column=0) self.elements['searchEntry'].bind("<Key>",self.searchItems_call) #ITEMS ADMIN AREA self.elements['itemsList']=Listbox(self.rootFrame) self.elements['itemsList'].grid(row=1,column=0,rowspan=900,sticky=N+S+W) self.elements['itemsList'].bind("<Button-1>",self.displayInfoItem_call) self.elements['itemInfoName']=Label(self.rootFrame,text="Item Name") self.elements["itemInfoName"].grid(row=1,column=2) self.elements["itemInfoQuantityUsed"]=Label(self.rootFrame,text="Number Used: 0") self.elements["itemInfoQuantityUsed"].grid(row=2,column=2) self.elements["itemInfoQuantityTotal"]=Label(self.rootFrame,text="Total: OVER 9000!!!") self.elements["itemInfoQuantityTotal"].grid(row=3,column=2) self.elements["itemInfoTags"]=Label(self.rootFrame,text="Tags:\nTag1 Tag2 Tag3") self.elements["itemInfoTags"].grid(row=4,column=2) self.elements["itemInfoDaysAllowed"]=Label(self.rootFrame,text="Days Allowed: 555") self.elements["itemInfoDaysAllowed"].grid(row=5,column=2) self.elements["itemInfoPicture"]=Label(self.rootFrame,text="PICTURE WILL GO HERE") self.elements["itemInfoPicture"].grid(row=6,column=2,columnspan=2) self.elements['modifyItemButton']=Button(self.rootFrame,text="Modify Item",command=self.modifyItem_call) self.elements['modifyItemButton'].grid(row=1,column=3,rowspan=2,sticky=E) self.elements['removeItemButton']=Button(self.rootFrame,text="Remove Item",command=self.removeItem_call) self.elements['removeItemButton'].grid(row=3,column=3,rowspan=2,sticky=E) self.elements["addItemButton"]=Button(self.rootFrame,text="Add Items",command=self.addItem_call) self.elements['addItemButton'].grid(row=5,column=3,sticky=E) self.itemImage=ImageTk.PhotoImage(file="Image-not-found.gif") self.elements["itemInfoPicture"].config(image=self.itemImage) #PERSON ADMIN AREA self.elements["peopleList"]=Listbox(self.rootFrame) self.elements['peopleList'].grid(row=1000,column=0,rowspan=999,sticky=N+S+W) #yes i mean row=1000 self.elements['peopleList'].bind("<Button-1>",self.displayPersonInfo_call) self.elements['personInfoName']=Label(self.rootFrame,text="Name Goes Here") self.elements['personInfoName'].grid(row=1000,column=2) self.elements['personInfoRoom']=Label(self.rootFrame,text="Room: Here") self.elements['personInfoRoom'].grid(row=1001,column=2) self.elements['personInfoIdNumber']=Label(self.rootFrame,text="IDNumber: Here") self.elements['personInfoIdNumber'].grid(row=1002,column=2) self.elements['personInfoPhone']=Label(self.rootFrame,text="PHONE NUMBER HERE") self.elements['personInfoPhone'].grid(row=1003,column=2) self.elements['personInfoEmail']=Label(self.rootFrame,text="Email Here") self.elements['personInfoEmail'].grid(row=1004,column=2) self.elements['modifyPersonButton']=Button(self.rootFrame,text="Modify Person",command=self.modifyPerson_call) self.elements['modifyPersonButton'].grid(row=1000,column=3,sticky=E,rowspan=2) self.elements['removePersonButton']=Button(self.rootFrame,text="Remove Person",command=self.removePerson_call) self.elements['removePersonButton'].grid(row=1002,column=3,sticky=E,rowspan=2) self.elements['addPersonButton']=Button(self.rootFrame,text="Add Person",command=self.addPerson_call) self.elements['addPersonButton'].grid(row=1004,column=3,rowspan=2,sticky=E) #initialize the lists self.items=items() self.searchedItems=[] for x in self.items: self.searchedItems.append(x) self.people=people() self.searchedPeople=[] for x in self.people: self.searchedPeople.append(x) self.redrawLists() #scrollbars self.elements['peopleListScroll']=Scrollbar(self.rootFrame,command=self.elements['peopleList'].yview) self.elements['peopleListScroll'].grid(row=1000,column=1,rowspan=999,sticky=N+S+W) self.elements['peopleList'].config(yscrollcommand=self.elements['peopleListScroll'].set) self.elements['itemsListScroll']=Scrollbar(self.rootFrame,command=self.elements['itemsList'].yview) self.elements['itemsListScroll'].grid(row=1,column=1,rowspan=900,sticky=N+S+W) self.elements['itemsList'].config(yscrollcommand=self.elements['itemsListScroll'].set)