Code Duplication    Length = 12-15 lines in 2 locations

doorstop/core/publisher_latex.py 1 location

@@ 98-112 (lines=15) @@
95
                    yield label_links
96
97
            # Add custom publish attributes
98
            if item.document and item.document.publish:
99
                header_printed = False
100
                for attr in item.document.publish:
101
                    if not item.attribute(attr):
102
                        continue
103
                    if not header_printed:
104
                        header_printed = True
105
                        yield "\\begin{longtable}{|l|l|}"
106
                        yield "Attribute & Value\\\\"
107
                        yield "\\hline"
108
                    yield "{} & {}".format(attr, item.attribute(attr))
109
                if header_printed:
110
                    yield "\\end{longtable}"
111
                else:
112
                    yield ""
113
114
        yield ""  # break between items
115

doorstop/core/publisher.py 1 location

@@ 592-603 (lines=12) @@
589
                    yield label_links
590
591
            # Add custom publish attributes
592
            if item.document and item.document.publish:
593
                header_printed = False
594
                for attr in item.document.publish:
595
                    if not item.attribute(attr):
596
                        continue
597
                    if not header_printed:
598
                        header_printed = True
599
                        yield ""
600
                        yield "| Attribute | Value |"
601
                        yield "| --------- | ----- |"
602
                    yield "| {} | {} |".format(attr, item.attribute(attr))
603
                yield ""
604
605
        yield ""  # break between items
606