def serialize(self, break_lines: bool = False) -> str:
        """Serialize all the segments added to this object.
        :param break_lines: if True, insert line break after each segment terminator.
        """
        header = self.get_header_segment()
        footer = self.get_footer_segment()
        out = []

        if header:
            out.append(header)
        out += self.segments
        if footer:
            out.append(footer)

        return Serializer(self.characters).serialize(
            out,
            self.has_una_segment,
            break_lines,
        )
Exemple #2
0
 def serialize(self):
     u"""Serialize all the segments added to this object."""
     return Serializer().serialize(self.segments, self.has_una_segment)
Exemple #3
0
def serializer():
    return Serializer()
Exemple #4
0
 def serialize(self) -> str:
     """Serialize all the segments added to this object."""
     return Serializer(self.characters).serialize(self.segments,
                                                  self.has_una_segment)
Exemple #5
0
 def setUp(self):
     self.serializer = Serializer()
Exemple #6
0
 def serialize(self, break_lines=False) -> str:
     """Serialize all the segments added to this object."""
     return Serializer().serialize(self.segments, self.has_una_segment,
                                   break_lines)
Exemple #7
0
 def serialize(self, break_lines: bool = False) -> str:
     """Serialize all the segments added to this object.
     :param break_lines: if True, insert line break after each segment terminator.
     """
     return Serializer().serialize(self.segments, self.has_una_segment,
                                   break_lines)