(self, parent=None, previous_element=None)
Sets up the initial relations between this element and
        other elements.
Sets up the initial relations between this element and
        other elements.
Sets up the initial relations between this element and other elements .
def setup(self, parent=None, previous_element=None):
        """Sets up the initial relations between this element and
        other elements."""
        self.parent = parent
        self.previous_element = previous_element
        if previous_element is not None:
            self.previous_element.next_element = self
        self.next_element = None
        self.previous_sibling = None
        self.next_sibling = None
        if self.parent is not None and self.parent.contents:
            self.previous_sibling = self.parent.contents[-1]
            self.previous_sibling.next_sibling = self
def setup ( self , parent = None , previous_element = None ) : self . parent = parent self . previous_element = previous_element if previous_element is not None : self . previous_element . next_element = self self . next_element = None self . previous_sibling = None self . next_sibling = None if self . parent is not None and self . parent . contents : self . previous_sibling = self . parent . contents [ - 1 ] self . previous_sibling . next_sibling = self