Exemple #1
0
  def result(self):
    s=""
    for actname in self.m_request_actname:
      if self.m_actnames_final.has_key(actname):
        time=str(self.m_actnames_final[actname])
      else:
        time=""
      s += actname
      s += " "
      s += time
      s += "\n"
    return s
  def output(self):
    workbook = xlwt.Workbook(encoding='gbk')
    sheet = workbook.add_sheet('Sheet 1', cell_overwrite_ok=True)
    i=3
    for actname in self.m_request_actname:
      if self.m_actnames_final.has_key(actname):
        time=self.m_actnames_final[actname][2]
      else:
        time="error"
      sheet.write(i,0,actname)
      sheet.write(i,1,time)
      i +=1
    workbook.save('pcl.xlsx')

ar = awkv2.controller(data,request)
ar.subscribe(collect_pcltime())
ar.run()
ar.print_results()
Exemple #2
0
            s += data
            s += "\n"
        return s

    def output(self):
        workbook = xlwt.Workbook(encoding='gbk')
        sheet = workbook.add_sheet('Sheet 1', cell_overwrite_ok=True)
        i = 0
        time_str = ""
        for time in self.time_seq:
            for j in range(0, len(self.tuxedo_log[time]) / 2):
                porg_name = self.tuxedo_log[time][j * 2]
                queued = int(self.tuxedo_log[time][j * 2 + 1])
                if queued > 10:
                    time_str = time.strip('\n')
                    time_format = "%a %b %d %H:%M:%S EAT %Y"
                    time_fin = str(datetime.datetime.strptime(time_str,
                                                              time_format))
                    sheet.write(i, 0, time_fin)
                    sheet.write(i, 1, porg_name)
                    sheet.write(i, 2, queued)
                    i += 1

        workbook.save('time.xls')


ar = awkv2.controller(data_file)
ar.subscribe(collect_pcltime())
ar.run()
ar.print_results()