Mercurial > libervia-backend
diff sat_frontends/jp/xmlui_manager.py @ 3407:2f0be2b7de68
jp: replace `no_lf` argument by `end` in `disp` (same as in `print`)
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 12 Nov 2020 14:53:16 +0100 |
parents | 89d97776fd34 |
children | be6d91572633 |
line wrap: on
line diff
--- a/sat_frontends/jp/xmlui_manager.py Thu Nov 12 14:53:15 2020 +0100 +++ b/sat_frontends/jp/xmlui_manager.py Thu Nov 12 14:53:16 2020 +0100 @@ -199,13 +199,13 @@ except AttributeError: return None - async def show(self, no_lf=False, ansi=""): + async def show(self, end='\n', ansi=""): """show label - @param no_lf(bool): same as for [JP.disp] + @param end(str): same as for [JP.disp] @param ansi(unicode): ansi escape code to print before label """ - self.disp(A.color(ansi, self.value), no_lf=no_lf) + self.disp(A.color(ansi, self.value), end=end) class JidWidget(xmlui_base.JidWidget, TextWidget): @@ -383,7 +383,7 @@ async def show(self): for child in self.children: - no_lf = False + end = '\n' # we check linked widget type # to see if we want the label on the same line or not if child.type == "label": @@ -396,10 +396,10 @@ "string", "jid_input", ): - no_lf = True + end = ' ' elif wid_type == "bool" and for_widget.read_only: - no_lf = True - await child.show(no_lf=no_lf, ansi=A.FG_CYAN) + end = ' ' + await child.show(end=end, ansi=A.FG_CYAN) else: await child.show()