def __init__(self):
        """
        Constructor.

        Any inheriting class should add a description to the argparser and
        extend it with additional arguments as needed.
        """
        # define argument parser and add version argument
        self.argparser = argparse.ArgumentParser()
        self.argparser.add_argument('--version', action='version',
                                    version="mtools version {0} || Python {1}".format(
                                        __version__, sys.version))
        self.argparser.add_argument('--no-progressbar', action='store_true',
                                    default=False,
                                    help='disables progress bar')
        self.is_stdin = not sys.stdin.isatty()

        # Set stdout encoding to utf-8 if not set
        # Need to check for nose because it monkey patches sys.stdout:
        #     https://github.com/nose-devs/nose/issues/1065
        if ('nose' not in sys.modules.keys()
                and hasattr(sys.stdout, 'encoding')
                and not sys.stdout.encoding):
            sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
def __init__ ( self ) : self . argparser = argparse . ArgumentParser ( ) self . argparser . add_argument ( '--version' , action = 'version' , version = "mtools version {0} || Python {1}" . format ( __version__ , sys . version ) ) self . argparser . add_argument ( '--no-progressbar' , action = 'store_true' , default = False , help = 'disables progress bar' ) self . is_stdin = not sys . stdin . isatty ( ) if ( 'nose' not in sys . modules . keys ( ) and hasattr ( sys . stdout , 'encoding' ) and not sys . stdout . encoding ) : sys . stdout = codecs . getwriter ( 'utf-8' ) ( sys . stdout )
Constructor.

        Any inheriting class should add a description to the argparser and
        extend it with additional arguments as needed.