Example #1
0
 def data_title(self, sheet, data_title_list, row, col_start_index=1):
     '''写入数据名称
     @param data_title_list: 第一行为标题,这里输入的是一个list
     '''
     if data_title_list and isinstance(data_title_list, list):
         index = col_start_index
         for data_title in data_title_list:
             self.write(sheet, row, index, data_title, data_title_style())
             if len(utils.to_unicode(data_title)) * 367  > sheet.col(index).width:
                 sheet.col(index).width = len(utils.to_unicode(data_title)) * 367
             index += 1
Example #2
0
 def data_title(self, sheet, data_title_list, row, col_start_index=1):
     '''写入数据名称
     @param data_title_list: 第一行为标题,这里输入的是一个list
     '''
     if data_title_list and isinstance(data_title_list, list):
         index = col_start_index
         for data_title in data_title_list:
             self.write(sheet, row, index, data_title, data_title_style())
             if len(utils.to_unicode(data_title)) * 367 > sheet.col(
                     index).width:
                 sheet.col(index).width = len(
                     utils.to_unicode(data_title)) * 367
             index += 1
Example #3
0
 def data_seq(self, sheet, seq, row, col=1):
     '''写入测试次数,判断seq是否等于Average,如果为整型,将以整型写入,如果为字符,将以字符写入'''
     try:
         seq = int(seq)
         font_colour = 0x08
     except Exception:
         if seq == "Average":
             font_colour = 0x0A
         else:
             font_colour = 0x08
     
     self.write(sheet, row, col, seq, data_seq_style(font_colour=font_colour))
     if len(utils.to_unicode(str(seq))) * 367  > sheet.col(col).width:
         sheet.col(col).width = len(utils.to_unicode(str(seq))) * 367
Example #4
0
 def data_seq(self, sheet, seq, row, col=1):
     '''写入测试次数,判断seq是否等于Average,如果为整型,将以整型写入,如果为字符,将以字符写入'''
     try:
         seq = int(seq)
         font_colour = 0x08
     except Exception:
         if seq == "Average":
             font_colour = 0x0A
         else:
             font_colour = 0x08
     self.write(sheet, row, col, seq,
                data_seq_style(font_colour=font_colour))
     if len(utils.to_unicode(str(seq))) * 367 > sheet.col(col).width:
         sheet.col(col).width = len(utils.to_unicode(str(seq))) * 367
Example #5
0
 def write_cell(self, sheet, value, row, col):
     '''写入单个cell'''
     self.write(sheet, row, col, value, cell_style())
     if len(utils.to_unicode(value)) * 367 > sheet.col(col).width:
         sheet.col(col).width = len(utils.to_unicode(value)) * 367
Example #6
0
 def write_cell(self, sheet, value, row, col):
     '''写入单个cell'''
     self.write(sheet, row, col, value, cell_style())
     if len(utils.to_unicode(value)) * 367  > sheet.col(col).width:
         sheet.col(col).width = len(utils.to_unicode(value)) * 367
Example #7
0
 def data_seq_bak(self, sheet, seq, row, style, col=1):
     '''写入测试次数,判断seq是否等于Average,如果为整型,将以整型写入,如果为字符,将以字符写入'''
     self.write(sheet, row, col, seq, style)
     if len(utils.to_unicode(str(seq))) * 367 > sheet.col(col).width:
         sheet.col(col).width = len(utils.to_unicode(str(seq))) * 367