Ejemplo n.º 1
0
 def buildSurplusCells(self, adapters, objectOrDict):
     root = Parse(tag="xx")
     next = root
     for adapter, name, symbols in adapters:
         hasKey, obj = self._getObj(name, objectOrDict)
         cell = Parse(tag="td")
         if hasKey:
             cell.body = adapter.toString(obj)
         else:
             self.exception(cell, "attribute missing")
         next.more = cell
         next = cell
     return root.more
 def _makeCell(self, anObject):
     aCell = Parse(tag="td")
     try:
         aCell.body = self._typeAdapter.toString(anObject, aCell)
     except Exception, e:
         self.exception(aCell, e)
Ejemplo n.º 3
0
 def CellOutput(self):
     cell = Parse(tag="td")
     cell.leader = ""
     cell.body = Fixture.escape(self, self._unescape(self.Text))
     return self._GenerateOutput(cell)
Ejemplo n.º 4
0
 def testBlankCellHandlerParseWithCell(self):        
     h = BlankCellHandler()
     cell = Parse(tag="td", body="blank")
     assert h.parse(cell, None) == (OK, "")
     cell.body = "fubar"
     assert h.parse(cell, None) == (NEXT, None)
Ejemplo n.º 5
0
 def _makeCell(self, anObject):
     aCell = Parse(tag="td")
     try:
         aCell.body = self._typeAdapter.toString(anObject, aCell)
     except Exception, e:
         self.exception(aCell, e)
Ejemplo n.º 6
0
 def CellOutput(self):
     cell = Parse(tag="td")
     cell.leader = ""
     cell.body = Fixture.escape(self, self._unescape(self.Text))
     return self._GenerateOutput(cell)
Ejemplo n.º 7
0
 def testBlankCellHandlerParseWithCell(self):
     h = BlankCellHandler()
     cell = Parse(tag="td", body="blank")
     assert h.parse(cell, None) == (OK, "")
     cell.body = "fubar"
     assert h.parse(cell, None) == (NEXT, None)