comparison frontends/src/jp/cmd_input.py @ 2293:cbc989508474

jp (input/csv): fixed encoding issue in debug mode
author Goffi <goffi@goffi.org>
date Fri, 30 Jun 2017 01:08:13 +0200
parents d8e48c850ad2
children 8b37a62336c3
comparison
equal deleted inserted replaced
2292:bd4d8c73b1d3 2293:cbc989508474
138 self.disp(stdin.decode('utf-8')) 138 self.disp(stdin.decode('utf-8'))
139 self.disp(A.color(C.A_SUBHEADER, u'-------------')) 139 self.disp(A.color(C.A_SUBHEADER, u'-------------'))
140 self.disp(u'{indent}{prog} {static} {options} {positionals}'.format( 140 self.disp(u'{indent}{prog} {static} {options} {positionals}'.format(
141 indent = 4*u' ', 141 indent = 4*u' ',
142 prog=sys.argv[0], 142 prog=sys.argv[0],
143 static = ' '.join(self.args.command).encode('utf-8'), 143 static = ' '.join(self.args.command).decode('utf-8'),
144 options = u' '.join([o.encode('utf-8') for o in self._opts]), 144 options = u' '.join([o.decode('utf-8') for o in self._opts]),
145 positionals = u' '.join([p.encode('utf-8') for p in self._pos]) 145 positionals = u' '.join([p.decode('utf-8') for p in self._pos])
146 )) 146 ))
147 self.disp(u'\n') 147 self.disp(u'\n')
148 else: 148 else:
149 self.disp(u' (' + u', '.join(self._values_ori) + u')', 2, no_lf=True) 149 self.disp(u' (' + u', '.join(self._values_ori) + u')', 2, no_lf=True)
150 args = [sys.argv[0]] + self.args.command + self._opts + self._pos 150 args = [sys.argv[0]] + self.args.command + self._opts + self._pos