def compare(self): a = None b = None c = None for i in self.strategylist.selectedItems(): a = i.text() for j in self.MSL.selectedItems(): b = j.text() for x in self.IL.selectedItems(): c = x.text() if c == None: self.dwrongmsg = dateWrong("NI-C") self.dwrongmsg.show() elif a == None and b == None: self.dwrongmsg = dateWrong("NS") self.dwrongmsg.show() else: try: self.pyalgostrategy( c, self.strategylist.selectedItems()[0].text()) self.close() #except Exception as e: # print(str(e)) except: self.pyalgostrategy(c, "my" + self.MSL.selectedItems()[0].text()) self.close()
def compare(self): a = None for i in self.strategylist.selectedItems(): a = i.text() if a == None: self.dwrongmsg = dateWrong("NS") self.dwrongmsg.show() else: self.pyalgostrategy(self.strategylist.selectedItems()[0].text())
def se(self): path = "C:\\Users\\user\\Desktop\\lastest(8.19)\\cache" listC = [] for dirPath, dirNames, fileNames in os.walk(path): fileNames = [fi for fi in fileNames if fi.endswith(".csv")] for f in fileNames: listC.append(f.replace(".csv", "")) if len(listC) >= 1: print(listC) self.choosewindow = chooseWindow() self.choosewindow.show() else: if self.fileMenu.title() == "Item": self.dwrongmsg = dateWrong("NI-C", 1) else: self.dwrongmsg = dateWrong("NI-C") #no item choose self.dwrongmsg.show()
def re(self): path = "C:\\Users\\user\\Desktop\\lastest(8.19)\\cache" listR = [] for dirPath, dirNames, fileNames in os.walk(path): fileNames = [fi for fi in fileNames if fi.endswith(".csv")] for f in fileNames: listR.append(f) for r in range(len(listR)): if int(listR[r][0]) >= 1: self.reportwindow = tab_widget() self.reportwindow.show() #tab_widget() break elif len(listR) == -1: if self.fileMenu.title() == "Item": self.dwrongmsg = dateWrong("NS-C", 1) #no strategy choose else: self.dwrongmsg = dateWrong("NS-C") self.dwrongmsg.show()
def compare(self,index): a = None itemlist = (['中石化', '台泥', '竺元','aa','bb','cc','dd']) if index == 0: mylist = self.listWidget elif index == 1: mylist = self.listWidget2 elif index == 2: mylist = self.listWidget3 for i in mylist.selectedItems(): a = i.text()[:3].replace(" ","") if a == None and self.lineedit.text() == "": self.dwrongmsg = dateWrong("NE") # no enter print ("沒選擇啦嫩") self.dwrongmsg.show() elif a == None and self.lineedit.text() not in itemlist: self.dwrongmsg = dateWrong("NI") #no item print("沒有這項產品") self.dwrongmsg.show() elif int(self.year.currentText()) > int(self.year2.currentText()): self.dwrongmsg = dateWrong("T") #time error print ("date wrong1") self.dwrongmsg.show() elif int(self.year.currentText()) == int(self.year2.currentText()) and int(self.month.currentText()) >= \ int(self.month2.currentText()): self.dwrongmsg = dateWrong("T") print ("date wrong2") self.dwrongmsg.show() else: print ("date right") self.tt(index) self.close()
def compare(self): a = None for i in self.listWidget.selectedItems(): a = i.text() if a == None: self.dwrongmsg = dateWrong("NE") print ("沒選擇啦嫩") self.dwrongmsg.show() elif int(self.year.currentText()) > int(self.year2.currentText()): self.dwrongmsg = dateWrong("T") print ("date wrong1") self.dwrongmsg.show() elif int(self.year.currentText()) == int(self.year2.currentText()) and int(self.month.currentText()) >= \ int(self.month2.currentText()): self.dwrongmsg = dateWrong("T") print ("date wrong2") self.dwrongmsg.show() else: print ("date right") self.tt() self.close()