Exemplo n.º 1
0
 def _add_section(self, title, files):
     if not files:
         title = 'No %s' % title
     row = TableRow()
     cell = TableCell(Bold(title), bgcolor='DarkSeaGreen4')
     row.set(cell)
     self.maintable.append(row)
     self._add_files(files)
Exemplo n.º 2
0
 def _make_smallinfo(self, info):
     infotable = Table()
     infotable.append(TableRow(TableHeader('Small Information', colspan=2)))
     for k, v in info.items():
         row = TableRow()
         cell = TableCell('%s:' % k.capitalize())
         row.set(cell)
         cell = TableCell(v)
         row.append(cell)
         infotable.append(row)
     self.maintable.append(TableRow(TableCell(infotable)))
Exemplo n.º 3
0
class AuditGameDocument(BaseDocument):
    def set_info(self, unchanged, changed, extra):
        self.unchanged_files = unchanged
        self.changed_files = changed
        self.extra_files = extra
        self._add_section('Extra Files', extra)
        self._add_section('Changed Files', changed)
        #self._add_section('Unchanged Files', unchanged)
        self.urow = TableRow()
        self.ucell = TableCell(Bold('%d Unchanged Files' % len(self.unchanged_files)),
                               bgcolor='DarkSeaGreen4')
        anchor = Anchor('show', href='show')
        self.ucell.append(anchor)
        self.urow.append(self.ucell)
        self.maintable.append(self.urow)

    def append_unchanged_files(self):
        #self.urow._contents = []
        self.ucell = TableCell(Bold('Unchanged Files'), bgcolor='DarkSeaGreen4')
        self.urow.set(self.ucell)
        self._add_files(self.unchanged_files)
        
            
    def _add_section(self, title, files):
        if not files:
            title = 'No %s' % title
        row = TableRow()
        cell = TableCell(Bold(title), bgcolor='DarkSeaGreen4')
        row.set(cell)
        self.maintable.append(row)
        self._add_files(files)
        
    def _add_files(self, files):
        for afile in files:
            row = TableRow()
            cell = TableCell(afile, bgcolor='DarkSeaGreen2')
            row.set(cell)
            self.maintable.append(row)
Exemplo n.º 4
0
 def _add_files(self, files):
     for afile in files:
         row = TableRow()
         cell = TableCell(afile, bgcolor='DarkSeaGreen2')
         row.set(cell)
         self.maintable.append(row)
Exemplo n.º 5
0
 def _make_filemanage_anchor_row(self, name, label, action):
     row = TableRow()
     anchor = Anchor(label, href=make_url(action, name), style="font-size: xx-small")
     cell = TableCell(anchor, bgcolor='DarkSeaGreen4')
     row.set(cell)
     return row