comparison mercurial/utils/procutil.py @ 43787:be8552f25cab

cleanup: fix docstring formatting This is just removing the b'' prefix (except demandimportpy2), and making sure it is triple quoted. I skipped the mapping.py module in zope because that's 3rd party code. Differential Revision: https://phab.mercurial-scm.org/D7539
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 01 Dec 2019 18:46:10 -0500
parents 664e24207728
children 5606e1cb4685
comparison
equal deleted inserted replaced
43786:421ea5772039 43787:be8552f25cab
247 b'pipe:': pipefilter, 247 b'pipe:': pipefilter,
248 } 248 }
249 249
250 250
251 def filter(s, cmd): 251 def filter(s, cmd):
252 b"filter a string through a command that transforms its input to its output" 252 """filter a string through a command that transforms its input to its
253 output"""
253 for name, fn in pycompat.iteritems(_filtertable): 254 for name, fn in pycompat.iteritems(_filtertable):
254 if cmd.startswith(name): 255 if cmd.startswith(name):
255 return fn(s, cmd[len(name) :].lstrip()) 256 return fn(s, cmd[len(name) :].lstrip())
256 return pipefilter(s, cmd) 257 return pipefilter(s, cmd)
257 258
345 346
346 def shellenviron(environ=None): 347 def shellenviron(environ=None):
347 """return environ with optional override, useful for shelling out""" 348 """return environ with optional override, useful for shelling out"""
348 349
349 def py2shell(val): 350 def py2shell(val):
350 b'convert python object into string that is useful to shell' 351 """convert python object into string that is useful to shell"""
351 if val is None or val is False: 352 if val is None or val is False:
352 return b'0' 353 return b'0'
353 if val is True: 354 if val is True:
354 return b'1' 355 return b'1'
355 return pycompat.bytestr(val) 356 return pycompat.bytestr(val)