@@ -484,6 +484,8 @@ def __init__(
484
484
int : bool = False ,
485
485
auto_suggest : Optional [AutoSuggest ] = None ,
486
486
style : Optional [BaseStyle ] = None ,
487
+ fg : Optional [str ] = "" ,
488
+ bg : Optional [str ] = "" ,
487
489
style_transformation : Optional [StyleTransformation ] = None ,
488
490
swap_light_and_dark_colors : FilterOrBool = False ,
489
491
color_depth : Optional [ColorDepth ] = None ,
@@ -543,7 +545,6 @@ def __init__(
543
545
self .int = int
544
546
self .action = action
545
547
self .bottom_toolbar = bottom_toolbar
546
- self .style = style
547
548
self .style_transformation = style_transformation
548
549
self .swap_light_and_dark_colors = swap_light_and_dark_colors
549
550
self .color_depth = true_color #color_dept
@@ -579,6 +580,15 @@ def __init__(
579
580
self .layout = self ._create_layout ()
580
581
self .app = self ._create_application (editing_mode , erase_when_done )
581
582
583
+ if fg or bg != "" :
584
+ from quo .style .style import Style
585
+
586
+ setStyle = Style .add ({' ' :"fg:" + str (fg ) + " bg:" + str (bg )})
587
+ self .style = setStyle
588
+ else :
589
+ self .style = style
590
+
591
+
582
592
if bind_ :
583
593
from quo .keys import bind as _bind
584
594
@@ -1064,7 +1074,14 @@ class itself. For these, passing in ``None`` will keep the current
1064
1074
# then we loose the advantage of mypy and pyflakes to be able
1065
1075
# to verify the code.
1066
1076
if text is not None :
1067
- self .text = text
1077
+ import re
1078
+
1079
+ if re .search ("^<.*>$" , str (text )) is not None :
1080
+ from quo .text .html import Text
1081
+ inpText = Text (str (text ))
1082
+ self .text = inpText
1083
+ else :
1084
+ self .text = text
1068
1085
if editing_mode is not None :
1069
1086
self .editing_mode = editing_mode
1070
1087
if refresh_interval is not None :
@@ -1084,7 +1101,13 @@ class itself. For these, passing in ``None`` will keep the current
1084
1101
if bind is not None :
1085
1102
self .bind = bind
1086
1103
if bottom_toolbar is not None :
1087
- self .bottom_toolbar = bottom_toolbar
1104
+ import re
1105
+ if re .search ("^<.*>$" , str (bottom_toolbar )) is not None :
1106
+ from quo .text .html import Text
1107
+ bttmtlbrText = Text (str (bottom_toolbar ))
1108
+ self .bottom_toolbar = bttmtlbrText
1109
+ else :
1110
+ self .bottom_toolbar = bottom_toolbar
1088
1111
if style is not None :
1089
1112
self .style = style
1090
1113
if color_depth is not None :
@@ -1096,7 +1119,13 @@ class itself. For these, passing in ``None`` will keep the current
1096
1119
if swap_light_and_dark_colors is not None :
1097
1120
self .swap_light_and_dark_colors = swap_light_and_dark_colors
1098
1121
if rprompt is not None :
1099
- self .rprompt = rprompt
1122
+ import re
1123
+ if re .search ("^<.*>$" , str (rprompt )) is not None :
1124
+ from quo .text .html import Text
1125
+ rprmptText = Text (str (rprompt ))
1126
+ self .rprompt = rprmptText
1127
+ else :
1128
+ self .rprompt = rprompt
1100
1129
if multiline is not None :
1101
1130
self .multiline = multiline
1102
1131
if elicit_continuation is not None :
@@ -1124,7 +1153,15 @@ class itself. For these, passing in ``None`` will keep the current
1124
1153
if input_processors is not None :
1125
1154
self .input_processors = input_processors
1126
1155
if placeholder is not None :
1127
- self .placeholder = placeholder
1156
+ import re
1157
+
1158
+ if re .search ("^<.*>$" , str (placeholder )) is not None :
1159
+ from quo .text .html import Text
1160
+ plchldrText = Text (str (placeholder ))
1161
+ self .placeholder = plchldrText
1162
+ else :
1163
+ self .placeholder = placeholder
1164
+
1128
1165
if reserve_space_for_menu is not None :
1129
1166
self .reserve_space_for_menu = reserve_space_for_menu
1130
1167
if system_prompt is not None :
0 commit comments