def classify(self, folder): startdate = self.ui.dateEdit.date() startdate = startdate.toPyDate() startdate = startdate.strftime( "%Y/%m/%d") #converts date from dateedit to tushare readable date enddate = self.ui.dateEdit_2.date() enddate = enddate.toPyDate() enddate = enddate.strftime("%Y/%m/%d") option = self.ui.comboBox.currentText() option = str(option) #if (self.ui.treewidget) == 0: #self.ui.label.setText("Need to select at least one query") #return root = self.ui.treeWidget_2.invisibleRootItem( ) # This is for iterating child items child_count = root.childCount() texts = [] if child_count == 0: return for i in range(child_count): item = root.child(i) text = item.text(0) #with 3 part'stock_name'+'-'+'code'+'-'+action texts.append(text) labels = [k for k in texts] #items = ([x.encode("utf-8") for x in labels]) width = self.ui.webView.width( ) #give width and height of user's screen so that graphs can be generated with dynamic size height = self.ui.webView.height() mode_combo = self.ui.combobox.currentText() graphpage(labels, mode_combo, startdate, enddate, option, width, height) #labels:复权ork线or分笔 option:hfq, qfq or 15, 30, D, etc self.ui.webView.reload() #refreshes webengine self.ui.webView.repaint() self.ui.webView.update()
def classify(self, folder): startdate = self.ui.dateEdit.date() startdate = startdate.toPyDate() startdate = startdate.strftime("%Y/%m/%d")#converts date from dateedit to tushare readable date enddate = self.ui.dateEdit_2.date() enddate = enddate.toPyDate() enddate = enddate.strftime("%Y/%m/%d") option = self.ui.comboBox.currentText() option = str(option) #if (self.ui.treewidget) == 0: #self.ui.label.setText("Need to select at least one query") #return root = self.ui.treeWidget_2.invisibleRootItem()# This is for iterating child items child_count = root.childCount() texts = [] if child_count==0: return for i in range(child_count): item = root.child(i) text = item.text(0)#with 3 part'stock_name'+'-'+'code'+'-'+action texts.append(text) labels = [k for k in texts] #items = ([x.encode("utf-8") for x in labels]) width = self.ui.webView.width()#give width and height of user's screen so that graphs can be generated with dynamic size height = self.ui.webView.height() graphpage(labels, startdate,enddate,option,width, height)#labels:复权ork线or分笔 option:hfq, qfq or 15, 30, D, etc self.ui.webView.reload()#refreshes webengine self.ui.webView.repaint() self.ui.webView.update()
def classify(self, folder): items = [] startdate = self.ui.dateEdit.date() startdate = startdate.toPyDate() startdate = startdate.strftime( "%Y/%m/%d") #converts date from dateedit to tushare readable date enddate = self.ui.dateEdit_2.date() enddate = enddate.toPyDate() enddate = enddate.strftime("%Y/%m/%d") option = self.ui.comboBox.currentText() option = str(option) #if (self.ui.treewidget) == 0: #self.ui.label.setText("Need to select at least one query") #return root = self.ui.treeWidget_2.invisibleRootItem( ) # This is for iterating child items child_count = root.childCount() if child_count == 0: return for i in range(child_count): if root.child(i).child(0): array = [] temp = root.child(i) #mergelist = self.recurse(temp,array) #print mergelist parent = root.child(i).text(0) mergelist = [] for j in range(temp.childCount()): while temp.child(j).childCount() != 0: #self.ui.label.setText("Error: Invalid Tree!") return txt = temp.child(j).text(0) mergelist.append(txt) mergelist.insert(0, parent) url = self.graphmerge(mergelist) items.append(url) else: item = root.child(i) url = item.text(0) items.append(url) labels = [k for k in items] items = ([x.encode("utf-8") for x in labels]) width = self.ui.widget.width( ) #give width and height of user's screen so that graphs can be generated with dynamic size height = self.ui.widget.height() graphpage(labels, startdate, enddate, option, width, height) #labels:复权ork线or分笔 option:hfq, qfq or 15, 30, D, etc self.ui.widget.reload() #refreshes webengine self.ui.widget.repaint() self.ui.widget.update()