parameters: ()
docstring: Invoked when the script is run directly by the python interpreter
docstring_summary: Invoked when the script is run directly by the python interpreter
docstring_tokens: Invoked when the script is run directly by the python interpreter
function: def main():
      '''
      Invoked when the script is run directly by the python interpreter
      '''
      parser = argparse.ArgumentParser(
          description = 'Downloads a specific version of MinGW',
          formatter_class = argparse.ArgumentDefaultsHelpFormatter
      )
      parser.add_argument('--location',
          help = 'the location to download the compiler to',
          default = os.path.join(tempfile.gettempdir(), 'mingw-builds'))
      parser.add_argument('--arch', required = True, choices = ['i686', 'x86_64'],
          help = 'the target MinGW architecture string')
      parser.add_argument('--version', type = str2ver,
          help = 'the version of GCC to download')
      parser.add_argument('--threading', choices = ['posix', 'win32'],
          help = 'the threading type of the compiler')
      parser.add_argument('--exceptions', choices = ['sjlj', 'seh', 'dwarf'],
          help = 'the method to throw exceptions')
      parser.add_argument('--revision', type=int,
          help = 'the revision of the MinGW release')
      group = parser.add_mutually_exclusive_group()
      group.add_argument('-v', '--verbose', action='store_true',
          help='increase the script output verbosity')
      group.add_argument('-q', '--quiet', action='store_true',
          help='only print errors and warning')
      args = parser.parse_args()
  
      # Create the logger
      logger = logging.getLogger('mingw')
      handler = logging.StreamHandler()
      formatter = logging.Formatter('%(message)s')
      handler.setFormatter(formatter)
      logger.addHandler(handler)
      logger.setLevel(logging.INFO)
      if args.quiet:
          logger.setLevel(logging.WARN)
      if args.verbose:
          logger.setLevel(logging.DEBUG)
  
      # Get MinGW
      root_dir = root(location = args.location, arch = args.arch,
          version = args.version, threading = args.threading,
          exceptions = args.exceptions, revision = args.revision,
          log = logger)
  
      sys.stdout.write('%s\n' % os.path.join(root_dir, 'bin'))
function_tokens: def main ( ) : parser = argparse . ArgumentParser ( description = 'Downloads a specific version of MinGW' , formatter_class = argparse . ArgumentDefaultsHelpFormatter ) parser . add_argument ( '--location' , help = 'the location to download the compiler to' , default = os . path . join ( tempfile . gettempdir ( ) , 'mingw-builds' ) ) parser . add_argument ( '--arch' , required = True , choices = [ 'i686' , 'x86_64' ] , help = 'the target MinGW architecture string' ) parser . add_argument ( '--version' , type = str2ver , help = 'the version of GCC to download' ) parser . add_argument ( '--threading' , choices = [ 'posix' , 'win32' ] , help = 'the threading type of the compiler' ) parser . add_argument ( '--exceptions' , choices = [ 'sjlj' , 'seh' , 'dwarf' ] , help = 'the method to throw exceptions' ) parser . add_argument ( '--revision' , type = int , help = 'the revision of the MinGW release' ) group = parser . add_mutually_exclusive_group ( ) group . add_argument ( '-v' , '--verbose' , action = 'store_true' , help = 'increase the script output verbosity' ) group . add_argument ( '-q' , '--quiet' , action = 'store_true' , help = 'only print errors and warning' ) args = parser . parse_args ( ) # Create the logger logger = logging . getLogger ( 'mingw' ) handler = logging . StreamHandler ( ) formatter = logging . Formatter ( '%(message)s' ) handler . setFormatter ( formatter ) logger . addHandler ( handler ) logger . setLevel ( logging . INFO ) if args . quiet : logger . setLevel ( logging . WARN ) if args . verbose : logger . setLevel ( logging . DEBUG ) # Get MinGW root_dir = root ( location = args . location , arch = args . arch , version = args . version , threading = args . threading , exceptions = args . exceptions , revision = args . revision , log = logger ) sys . stdout . write ( '%s\n' % os . path . join ( root_dir , 'bin' ) )