| 804 | return self.payload.build_done(p) |
| 805 | |
| 806 | def do_build_ps(self): |
| 807 | # type: () -> Tuple[bytes, List[Tuple[Packet, List[Tuple[Field[Any, Any], str, bytes]]]]] # noqa: E501 |
| 808 | p = b"" |
| 809 | pl = [] |
| 810 | q = b"" |
| 811 | for f in self.fields_desc: |
| 812 | if isinstance(f, ConditionalField) and not f._evalcond(self): |
| 813 | continue |
| 814 | p = f.addfield(self, p, self.getfieldval(f.name)) |
| 815 | if isinstance(p, bytes): |
| 816 | r = p[len(q):] |
| 817 | q = p |
| 818 | else: |
| 819 | r = b"" |
| 820 | pl.append((f, f.i2repr(self, self.getfieldval(f.name)), r)) |
| 821 | |
| 822 | pkt, lst = self.payload.build_ps(internal=1) |
| 823 | p += pkt |
| 824 | lst.append((self, pl)) |
| 825 | |
| 826 | return p, lst |
| 827 | |
| 828 | def build_ps(self, internal=0): |
| 829 | # type: (int) -> Tuple[bytes, List[Tuple[Packet, List[Tuple[Any, Any, bytes]]]]] # noqa: E501 |