File tree Expand file tree Collapse file tree
elementary/messages/formats Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 TextStyle ,
2222 WhitespaceBlock ,
2323)
24- from elementary .messages .formats .html import ICON_TO_HTML
24+ from elementary .messages .formats .unicode import ICON_TO_UNICODE
2525from elementary .messages .message_body import Color , MessageBlock , MessageBody
2626
2727COLOR_TO_STYLE = {
3232
3333
3434def format_icon (icon : Icon ) -> str :
35- return ICON_TO_HTML [icon ]
35+ return ICON_TO_UNICODE [icon ]
3636
3737
3838def format_text_block (block : TextBlock ) -> str :
Original file line number Diff line number Diff line change 2929 UserSelectActionBlock ,
3030 WhitespaceBlock ,
3131)
32- from elementary .messages .formats .html import ICON_TO_HTML
32+ from elementary .messages .formats .unicode import ICON_TO_UNICODE
3333from elementary .messages .message_body import Color , MessageBlock , MessageBody
3434
3535COLOR_MAP = {
@@ -61,7 +61,7 @@ def __init__(
6161 self ._resolve_mention = resolve_mention or (lambda x : None )
6262
6363 def _format_icon (self , icon : Icon ) -> str :
64- return ICON_TO_HTML [icon ]
64+ return ICON_TO_UNICODE [icon ]
6565
6666 def _format_text_block (self , block : TextBlock ) -> str :
6767 if block .style == TextStyle .BOLD :
Original file line number Diff line number Diff line change 2424 TextStyle ,
2525 WhitespaceBlock ,
2626)
27- from elementary .messages .formats .html import ICON_TO_HTML
27+ from elementary .messages .formats .unicode import ICON_TO_UNICODE
2828from elementary .messages .message_body import MessageBlock , MessageBody
2929
3030
@@ -38,7 +38,7 @@ def __init__(self, table_style: TableStyle):
3838 self ._table_style = table_style
3939
4040 def format_icon (self , icon : Icon ) -> str :
41- return ICON_TO_HTML [icon ]
41+ return ICON_TO_UNICODE [icon ]
4242
4343 def format_text_block (self , block : TextBlock ) -> str :
4444 if block .style == TextStyle .BOLD :
Original file line number Diff line number Diff line change 2323 TextBlock ,
2424 WhitespaceBlock ,
2525)
26- from elementary .messages .formats .html import ICON_TO_HTML
26+ from elementary .messages .formats .unicode import ICON_TO_UNICODE
2727from elementary .messages .message_body import MessageBlock , MessageBody
2828
2929
@@ -47,7 +47,7 @@ def format_icon(self, icon: Icon) -> str:
4747 if self ._icon_style == IconStyle .OMIT :
4848 return ""
4949 elif self ._icon_style == IconStyle .UNICODE :
50- return ICON_TO_HTML [icon ]
50+ return ICON_TO_UNICODE [icon ]
5151 elif self ._icon_style == IconStyle .NAME :
5252 return f":{ icon .value } :"
5353 else :
Original file line number Diff line number Diff line change 11from elementary .messages .blocks import Icon
22
3- ICON_TO_HTML = {
3+ ICON_TO_UNICODE = {
44 Icon .RED_TRIANGLE : "🔺" ,
55 Icon .X : "❌" ,
66 Icon .WARNING : "⚠️" ,
1818}
1919
2020for icon in Icon :
21- if icon not in ICON_TO_HTML :
22- raise RuntimeError (f"No HTML representation for icon { icon } " )
21+ if icon not in ICON_TO_UNICODE :
22+ raise RuntimeError (f"No unicode representation for icon { icon } " )
You can’t perform that action at this time.
0 commit comments