当前位置: 首页>>代码示例>>Python>>正文


Python MOSES.getFeedbackBetweenDates方法代码示例

本文整理汇总了Python中MOSES.getFeedbackBetweenDates方法的典型用法代码示例。如果您正苦于以下问题:Python MOSES.getFeedbackBetweenDates方法的具体用法?Python MOSES.getFeedbackBetweenDates怎么用?Python MOSES.getFeedbackBetweenDates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MOSES的用法示例。


在下文中一共展示了MOSES.getFeedbackBetweenDates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: populateReport

# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getFeedbackBetweenDates [as 别名]
    def populateReport(self):
#        print "Populating report"
        entity_types = self.type_combo_box.getCheckedItems()
        if len(entity_types) == 0:
            entity_types = None
        data = MOSES.getFeedbackBetweenDates(self.user_id, self.password, self.start_date_edit.date().toPyDate(), self.end_date_edit.date().toPyDate(), entity_types)
        if data["total"] != 0: 
            self.helpfulness_report_table.setRowCount(1)
            self.helpfulness_report_table.setColumnCount(4)
            self.helpfulness_report_table.setHorizontalHeaderLabels(["Yes","No","Total","Helpfulness%"])
            self.helpfulness_report_table.setItem(0,0,QtGui.QTableWidgetItem(str(data["yes"])))
            self.helpfulness_report_table.setItem(0,1,QtGui.QTableWidgetItem(str(data["total"]-data["yes"])))
            self.helpfulness_report_table.setItem(0,2,QtGui.QTableWidgetItem(str(data["total"])))
            self.helpfulness_report_table.setItem(0,3,QtGui.QTableWidgetItem("%.2f%%"%(100*data["yes"]/data["total"])))
            #print data["data"][0].keys()
            data_headers = ["Time Stamp","Article Type","Item ID","FSN","Feedback","Feedback Comment"]
            table_rows = len(data["data"])
            self.helpfulness_data_table.setSortingEnabled(False)
            self.helpfulness_data_table.setRowCount(table_rows)
            self.helpfulness_data_table.setColumnCount(len(data_headers))
            self.helpfulness_data_table.setHorizontalHeaderLabels(data_headers)
            for row_index in range(table_rows):
                self.helpfulness_data_table.setItem(row_index,0,QtGui.QTableWidgetItem(str(data["data"][row_index]["create_stamp"])))
                self.helpfulness_data_table.setItem(row_index,1,QtGui.QTableWidgetItem(str(data["data"][row_index]["entity_type"])))
                self.helpfulness_data_table.setItem(row_index,2,QtGui.QTableWidgetItem(str(data["data"][row_index]["entity_id"])))
                self.helpfulness_data_table.setItem(row_index,3,QtGui.QTableWidgetItem(str(data["data"][row_index]["FSN"])))
                self.helpfulness_data_table.setItem(row_index,4,QtGui.QTableWidgetItem(str(data["data"][row_index]["feedback"])))
                self.helpfulness_data_table.setItem(row_index,5,QtGui.QTableWidgetItem(str(data["data"][row_index]["metadata"])))
            self.helpfulness_data_table.setSortingEnabled(True)
            self.helpfulness_data_table.resizeColumnsToContents()
            self.helpfulness_data_table.setColumnWidth(5,200)
            self.helpfulness_data_table.setWordWrap(True)
            self.helpfulness_data_table.resizeRowsToContents()
            self.alertMessage("Completed!","Finished summarizing feedback data for the selected entity types between %s and %s" %(self.start_date_edit.date().toPyDate(), self.end_date_edit.date().toPyDate()))
        else:
            self.alertMessage("No Data Available!","There is no feedback available for the selected entity types between %s and %s" %(self.start_date_edit.date().toPyDate(), self.end_date_edit.date().toPyDate()))
开发者ID:vinay87,项目名称:oink,代码行数:38,代码来源:FarmHand.py


注:本文中的MOSES.getFeedbackBetweenDates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。