Example #1
0
 def toHtml(self, valueDict=None, formatted=False):
     oldChildElements = self.childElements
     self.reset()
     for childElement in oldChildElements:
         self.__modifyChild__(childElement)
     lineBreak = Box.addChildElement(self, LineBreak())
     returnValue = Box.toHtml(self, valueDict, formatted=formatted)
     self.childElements = oldChildElements
     return returnValue
Example #2
0
 def toHtml(self, valueDict=None, formatted=False):
     oldChildElements = self.childElements
     self.reset()
     for childElement in oldChildElements:
         self.__modifyChild__(childElement)
     lineBreak = Box.addChildElement(self, LineBreak())
     returnValue = Box.toHtml(self, valueDict, formatted=formatted)
     self.childElements = oldChildElements
     return returnValue
Example #3
0
 def toHtml(self, formatted=False, *args, **kwargs):
     oldChildElements = self.childElements
     self.reset()
     for childElement in oldChildElements:
         self.__modifyChild__(childElement)
     lineBreak = Box.addChildElement(self, LineBreak())
     returnValue = Box.toHtml(self, formatted=formatted, *args, **kwargs)
     self._childElements = oldChildElements
     return returnValue
Example #4
0
    def __modifyChild__(self, childElement):
        width = childElement.style.pop('width', '')
        align = childElement.style.pop('float', 'left')

        if width == "0" or width == "hide":
            self.childElements.append(childElement)
        if not childElement.displayable:
            self.childElements.append(childElement)
            return

        if not childElement.tagName or width:
            container = Box.addChildElement(self, Box())
            container.addChildElement(childElement)
        else:
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            container = childElement
            self.childElements.append(childElement)

        container.style['float'] = align
        if width:
            container.style['vertical-align'] = 'middle'
            container.style['width'] = width
Example #5
0
    def __modifyChild__(self, childElement):
        height = childElement.style.pop('height', '')

        if not childElement.displayable:
            self.childElements.append(childElement)
        elif not childElement.tagName or height:
            container = Box()
            container.style['height'] = height
            childElement.style['height'] = "100%"
            container.style['clear'] = "both"
            container.addChildElement(childElement)
            return Box.addChildElement(self, container)
        else:
            childElement.style['clear'] = "both"
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            self.childElements.append(childElement)
Example #6
0
    def __modifyChild__(self, childElement):
        height = childElement.style.pop('height', '')

        if not childElement.displayable:
            self.childElements.append(childElement)
        elif not childElement.tagName or height:
            container = Box()
            container.style['height'] = height
            childElement.style['height'] = "100%"
            container.style['clear'] = "both"
            container.addChildElement(childElement)
            return Box.addChildElement(self, container)
        else:
            childElement.style['clear'] = "both"
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            self.childElements.append(childElement)
Example #7
0
    def __modifyChild__(self, childElement):
        width = childElement.style.pop('width', '')
        align = childElement.style.pop('float', 'left')

        if width == "0" or width == "hide":
            self.childElements.append(childElement)
        if not childElement.displayable:
            self.childElements.append(childElement)
            return

        if not childElement.tagName or width:
            container = Box.addChildElement(self, Box())
            container.addChildElement(childElement)
        else:
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            container = childElement
            self.childElements.append(childElement)

        container.style['float'] = align
        if width:
            container.style['vertical-align'] = 'middle'
            container.style['width'] = width