Method: rich.style.Style.__str__
Calls: 483, Exceptions: 0, Paths: 20Back
Path 1: 441 calls (0.91)
'none' (51) 'bold' (39) 'green' (24) 'red' (24) 'bold red' (18) 'italic' (15) 'magenta' (15) 'yellow' (15) 'cyan' (12) 'dim' (12)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 2: 8 calls (0.02)
'bold cyan' (2) 'bold green' (1) 'bold blue' (1) 'bold magenta' (1) 'bold yellow' (1) 'not bold red' (1) 'bold red' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 3: 6 calls (0.01)
'green' (1) 'yellow' (1) 'blue' (1) 'red' (1) 'cyan' (1) 'magenta' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 4: 5 calls (0.01)
'bold' (3) 'not bold' (2)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 5: 3 calls (0.01)
'#ff0000 on color(200)' (1) 'color(200) on #ff0000' (1) 'bright_red on black' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 6: 2 calls (0.0)
'link http://example.org' (1) 'link foo' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 7: 2 calls (0.0)
'italic' (2)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 8: 2 calls (0.0)
'underline' (2)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 9: 2 calls (0.0)
'bold magenta on red' (1) 'bold red on black' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 10: 2 calls (0.0)
'on orange4' (1) 'on green' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 11: 1 calls (0.0)
'dim' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 12: 1 calls (0.0)
'strike' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 13: 1 calls (0.0)
'reverse' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 14: 1 calls (0.0)
'blink' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 15: 1 calls (0.0)
'bold reverse red on blue' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 16: 1 calls (0.0)
'bold link https:/example.org' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 17: 1 calls (0.0)
'dim white' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 18: 1 calls (0.0)
'not bold italic red' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 19: 1 calls (0.0)
'none' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition
Path 20: 1 calls (0.0)
'bold dim italic underline blink blink2 reverse conceal strike underline2 frame encircle overline red on black' (1)
1def __str__(self) -> str:
2 """Re-generate style definition from attributes."""
3 if self._style_definition is None:
4 attributes: List[str] = []
5 append = attributes.append
6 bits = self._set_attributes
7 if bits & 0b0000000001111:
8 if bits & 1:
9 append("bold" if self.bold else "not bold")
10 if bits & (1 << 1):
11 append("dim" if self.dim else "not dim")
12 if bits & (1 << 2):
13 append("italic" if self.italic else "not italic")
14 if bits & (1 << 3):
15 append("underline" if self.underline else "not underline")
16 if bits & 0b0000111110000:
17 if bits & (1 << 4):
18 append("blink" if self.blink else "not blink")
19 if bits & (1 << 5):
20 append("blink2" if self.blink2 else "not blink2")
21 if bits & (1 << 6):
22 append("reverse" if self.reverse else "not reverse")
23 if bits & (1 << 7):
24 append("conceal" if self.conceal else "not conceal")
25 if bits & (1 << 8):
26 append("strike" if self.strike else "not strike")
27 if bits & 0b1111000000000:
28 if bits & (1 << 9):
29 append("underline2" if self.underline2 else "not underline2")
30 if bits & (1 << 10):
31 append("frame" if self.frame else "not frame")
32 if bits & (1 << 11):
33 append("encircle" if self.encircle else "not encircle")
34 if bits & (1 << 12):
35 append("overline" if self.overline else "not overline")
36 if self._color is not None:
37 append(self._color.name)
38 if self._bgcolor is not None:
39 append("on")
40 append(self._bgcolor.name)
41 if self._link:
42 append("link")
43 append(self._link)
44 self._style_definition = " ".join(attributes) or "none"
45 return self._style_definition