def table(self): secret_columns = [ c for c in self._columns if not self._data.permitted(c, pytis.data.Permission.VIEW) ] aligns = self._col_aligns() rows = self.dbrows() if len(rows) > 0: for row in rows: r = TR() for i, c in enumerate(row): if c in secret_columns: val = c.type().secret_export() else: val = c.export() if self._klass: style = self._klass(row, self._columns[i]) if style: r.append(TD(val, align=aligns[i], klass=style)) else: r.append(TD(val, align=aligns[i])) else: r.append(TD(val, align=aligns[i])) self._table.append(r) return self._table
def table(self): super(BrowsableDBTable, self).table() if self._uri is not None: controls = self.controls() rcontrols = TR(TD(colspan=len(self.columns()), *controls)) self._table.append(rcontrols) return self._table
def writeContent(self): s = "font-family: tahoma; font-size: 10pt;" t = TABLE() tr = TR(TH(BR(), style=s)) for i in range(16): tr.append(TH(hex(i), style=s)) t.append(tr) for j in range(0,128,16): tr = TR(TH(hex(j)),style=s) t.append(tr) for i in range(16): v = i+j tr.append(TD(EM(v), BR(), quote_body(repr(chr(v))))) self.write(t)
def table(self): secret_columns = [c for c in self._columns if not self._data.permitted(c, pytis.data.Permission.VIEW)] aligns = self._col_aligns() rows = self.dbrows() if len(rows) > 0: for row in rows: r = TR() for i, c in enumerate(row): if c in secret_columns: val = c.type().secret_export() else: val = c.export() if self._klass: style = self._klass(row, self._columns[i]) if style: r.append(TD(val, align=aligns[i], klass=style)) else: r.append(TD(val, align=aligns[i])) else: r.append(TD(val, align=aligns[i])) self._table.append(r) return self._table
#!/usr/bin/python from HyperText.HTML import BR, TABLE, TR, TH, TD, EM, quote_body from HyperText.Documents import Document t = TABLE() tr = TR(TH(BR())) for i in range(16): tr.append(TH(hex(i))) t.append(tr) for j in range(0,128,16): tr = TR(TH(hex(j))) t.append(tr) for i in range(16): v = i+j tr.append(TD(EM(v), BR(), quote_body(repr(chr(v))))) d = Document(t) print d
def _append_headers(self): headerline = TR(*[TH(h) for h in self._headers]) self._table.append(headerline)
#!/usr/bin/python from HyperText.HTML import BR, TABLE, TR, TH, TD, EM, quote_body from HyperText.Documents import Document t = TABLE() tr = TR(TH(BR())) for i in range(16): tr.append(TH(hex(i))) t.append(tr) for j in range(0, 128, 16): tr = TR(TH(hex(j))) t.append(tr) for i in range(16): v = i + j tr.append(TD(EM(v), BR(), quote_body(repr(chr(v))))) d = Document(t) print d