io_util module¶
Utils - printing - parsing cli args
- class io_util.ArgparseWrapper(*args, conflict_handler='resolve', formatter_class=<class 'argparse.RawTextHelpFormatter'>, **kwds)[source]¶
Bases:
object
- io_util.add_default_args(parser: ArgumentParser)[source]¶
- io_util.catch_output(arg: str, func: Callable, **func_kwds) str [source]¶
Run func while temporarily redirecting stdout. Then return the result from stdout.
- io_util.check_output(line: str) str [source]¶
Similar to subprocess.check_output, but with more detailed error messages
- io_util.debug(*args, **kwds)[source]¶
Similar to logging.debug, but without custom string formatting
- io_util.find_argument(parser: ArgumentParser, arg='arg_name')[source]¶
- io_util.has_argument(parser: ArgumentParser, arg='arg_name') bool [source]¶
- io_util.has_output(stream: ~typing.TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>, timeout=0)[source]¶
- io_util.log(*args, file=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, prefix='\x1b[33m···\x1b[0m', **kwds)[source]¶
Print to stderr