def NewCell(self,color=ColorType.WHITE): self.current_col=self.current_col+1 if self.current_col>self.number_col: logging.warning(" the number of the current column is bigger than the total number of declared columns.") if self.first_cell==True: self.page.append("<TD bgcolor=\""+ColorType.convert2hexa(color)+"\">") else: self.page.append("</TD> \n<TD bgcolor=\""+ColorType.convert2hexa(color)+"\">") self.first_cell=False
def NewCell(self,color=ColorType.WHITE): size = str(round(self.col_size[self.current_col]/sum(self.col_size)*100,0)) self.current_col=self.current_col+1 if self.current_col>self.number_col: logging.warning(" the number of the current column is bigger than the total number of declared columns.") if self.first_cell==True: self.page.append(' <td width=\'' + size + '%\' bgcolor=\'' + \ ColorType.convert2hexa(color)+ '\'>\n') else: self.page.append(' </td> \n' + \ ' <td width=\'' + size + '%\' bgcolor=\'' + \ ColorType.convert2hexa(color)+'\'>\n') self.first_cell=False
def NewCell(self, color=ColorType.WHITE): self.current_col = self.current_col + 1 if self.current_col > self.number_col: logging.warning( " the number of the current column is bigger than the total number of declared columns." ) if self.first_cell == True: self.page.append("<TD bgcolor=\"" + ColorType.convert2hexa(color) + "\">") else: self.page.append("</TD> \n<TD bgcolor=\"" + ColorType.convert2hexa(color) + "\">") self.first_cell = False
def WriteHTML(self,file): file.append(ScriptType.htmlscript(self.script)) file.append(FontType.convert2html(self.font)) file.append("<FONT COLOR=\""+\ ColorType.convert2hexa(self.color)+"\">") file.append(self.text+"</FONT>") file.append(FontType.convert2htmlclose(self.font)) file.append(ScriptType.htmlscriptclose(self.script))
def WriteHTML(self,file): if self.text=='': return file.append(ScriptType.htmlscript(self.script)) file.append(FontType.convert2html(self.font)) if self.color!=2: file.append('<font color=\'' + ColorType.convert2hexa(self.color)+'\'>') file.append(self.text+"</font>") else: file.append(self.text) file.append(FontType.convert2htmlclose(self.font)) file.append(ScriptType.htmlscriptclose(self.script))
def WriteHTML(self, file): if self.text == '': return file.append(ScriptType.htmlscript(self.script)) file.append(FontType.convert2html(self.font)) if self.color != 2: file.append('<font color=\'' + ColorType.convert2hexa(self.color) + '\'>') file.append(self.text + "</font>") else: file.append(self.text) file.append(FontType.convert2htmlclose(self.font)) file.append(ScriptType.htmlscriptclose(self.script))
def NewCell(self, color=ColorType.WHITE, span=1): size = 0 for ii in range(0, span): size += self.col_size[self.current_col + ii] size = str(round(size / sum(self.col_size) * 100, 0)) self.current_col = self.current_col + span if self.current_col > self.number_col: logging.getLogger('MA5').warning( " the number of the current column is bigger than the total number of declared columns." ) if self.first_cell == True: self.page.append(' <td width=\'' + size + '%\' bgcolor=\'' + ColorType.convert2hexa(color) + '\'') else: self.page.append(' </td> \n' + ' <td width=\'' + size + '%\' bgcolor=\'' + ColorType.convert2hexa(color) + '\'') if span > 1: self.page.append(' colspan=\"' + str(span) + '\"') self.page.append('>\n') self.first_cell = False