comparison sat_frontends/jp/cmd_input.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 559a625a236b
children be6d91572633
comparison
equal deleted inserted replaced
3406:4c15271118a2 3407:2f0be2b7de68
192 self.disp( 192 self.disp(
193 _("arguments in input data and in arguments sequence don't match"), 193 _("arguments in input data and in arguments sequence don't match"),
194 error=True, 194 error=True,
195 ) 195 )
196 self.host.quit(C.EXIT_DATA_ERROR) 196 self.host.quit(C.EXIT_DATA_ERROR)
197 end = '\n' if self.args.debug else ' '
197 self.disp( 198 self.disp(
198 A.color(C.A_HEADER, _("command {idx}").format(idx=self.idx)), 199 A.color(C.A_HEADER, _("command {idx}").format(idx=self.idx)),
199 no_lf=not self.args.debug, 200 end = end,
200 ) 201 )
201 stdin = "".join(self._stdin) 202 stdin = "".join(self._stdin)
202 if self.args.debug: 203 if self.args.debug:
203 self.disp( 204 self.disp(
204 A.color( 205 A.color(
224 positionals=" ".join(shlex.quote(p) for p in self._pos), 225 positionals=" ".join(shlex.quote(p) for p in self._pos),
225 ) 226 )
226 ) 227 )
227 self.disp("\n") 228 self.disp("\n")
228 else: 229 else:
229 self.disp(" (" + ", ".join(self._values_ori) + ")", 2, no_lf=True) 230 self.disp(" (" + ", ".join(self._values_ori) + ")", 2, end=' ')
230 args = [sys.argv[0]] + self.args.command + self._opts + self._pos 231 args = [sys.argv[0]] + self.args.command + self._opts + self._pos
231 p = await asyncio.create_subprocess_exec( 232 p = await asyncio.create_subprocess_exec(
232 *args, 233 *args,
233 stdin=subprocess.PIPE, 234 stdin=subprocess.PIPE,
234 stdout=subprocess.PIPE, 235 stdout=subprocess.PIPE,