Convert Python label dict to correspnding PDF rule string. Args: label: (dict) build rule for the label. Returns: PDF label rule string wrapped in "<<", ">>".
(label)
| 4910 | # William Chapman, 2021-01-06 |
| 4911 | |
| 4912 | def create_label_str(label): |
| 4913 | """Convert Python label dict to correspnding PDF rule string. |
| 4914 | |
| 4915 | Args: |
| 4916 | label: (dict) build rule for the label. |
| 4917 | Returns: |
| 4918 | PDF label rule string wrapped in "<<", ">>". |
| 4919 | """ |
| 4920 | s = "%i<<" % label["startpage"] |
| 4921 | if label.get("prefix", "") != "": |
| 4922 | s += "/P(%s)" % label["prefix"] |
| 4923 | if label.get("style", "") != "": |
| 4924 | s += "/S/%s" % label["style"] |
| 4925 | if label.get("firstpagenum", 1) > 1: |
| 4926 | s += "/St %i" % label["firstpagenum"] |
| 4927 | s += ">>" |
| 4928 | return s |
| 4929 | |
| 4930 | def create_nums(labels): |
| 4931 | """Return concatenated string of all labels rules. |
no test coverage detected
searching dependent graphs…