virtualEnvironment/lib/python2.7/site-packages/coverage/cmdline.py
def command_line(self, argv):
        """The bulk of the command line interface to Coverage.

        `argv` is the argument list to process.

        Returns 0 if all is well, 1 if something went wrong.

        """
        # Collect the command-line options.
        if not argv:
            self.help_fn(topic='minimum_help')
            return OK

        # The command syntax we parse depends on the first argument.  Classic
        # syntax always starts with an option.
        self.classic = argv[0].startswith('-')
        if self.classic:
            parser = ClassicOptionParser()
        else:
            parser = CMDS.get(argv[0])
            if not parser:
                self.help_fn("Unknown command: '%s'" % argv[0])
                return ERR
            argv = argv[1:]

        parser.help_fn = self.help_fn
        ok, options, args = parser.parse_args(argv)
        if not ok:
            return ERR

        # Handle help and version.
        if self.do_help(options, args, parser):
            return OK

        # Check for conflicts and problems in the options.
        if not self.args_ok(options, args):
            return ERR

        # Listify the list options.
        source = unshell_list(options.source)
        omit = unshell_list(options.omit)
        include = unshell_list(options.include)
        debug = unshell_list(options.debug)

        # Do something.
        self.coverage = self.covpkg.coverage(
            data_suffix = options.parallel_mode,
            cover_pylib = options.pylib,
            timid = options.timid,
            branch = options.branch,
            config_file = options.rcfile,
            source = source,
            omit = omit,
            include = include,
            debug = debug,
            )

        if 'debug' in options.actions:
            return self.do_debug(args)

        if 'erase' in options.actions or options.erase_first:
            self.coverage.erase()
        else:
            self.coverage.load()

        if 'execute' in options.actions:
            self.do_execute(options, args)

        if 'combine' in options.actions:
            self.coverage.combine()
            self.coverage.save()

        # Remaining actions are reporting, with some common options.
        report_args = dict(
            morfs = args,
            ignore_errors = options.ignore_errors,
            omit = omit,
            include = include,
            )

        if 'report' in options.actions:
            total = self.coverage.report(
                show_missing=options.show_missing, **report_args)
        if 'annotate' in options.actions:
            self.coverage.annotate(
                directory=options.directory, **report_args)
        if 'html' in options.actions:
            total = self.coverage.html_report(
                directory=options.directory, title=options.title,
                **report_args)
        if 'xml' in options.actions:
            outfile = options.outfile
            total = self.coverage.xml_report(outfile=outfile, **report_args)

        if options.fail_under is not None:
            if total >= options.fail_under:
                return OK
            else:
                return FAIL_UNDER
        else:
            return OK
def command_line(self, argv):
        # Collect the command-line options.
        if not argv:
            self.help_fn(topic='minimum_help')
            return OK

        # The command syntax we parse depends on the first argument.  Classic
        # syntax always starts with an option.
        self.classic = argv[0].startswith('-')
        if self.classic:
            parser = ClassicOptionParser()
        else:
            parser = CMDS.get(argv[0])
            if not parser:
                self.help_fn("Unknown command: '%s'" % argv[0])
                return ERR
            argv = argv[1:]

        parser.help_fn = self.help_fn
        ok, options, args = parser.parse_args(argv)
        if not ok:
            return ERR

        # Handle help and version.
        if self.do_help(options, args, parser):
            return OK

        # Check for conflicts and problems in the options.
        if not self.args_ok(options, args):
            return ERR

        # Listify the list options.
        source = unshell_list(options.source)
        omit = unshell_list(options.omit)
        include = unshell_list(options.include)
        debug = unshell_list(options.debug)

        # Do something.
        self.coverage = self.covpkg.coverage(
            data_suffix = options.parallel_mode,
            cover_pylib = options.pylib,
            timid = options.timid,
            branch = options.branch,
            config_file = options.rcfile,
            source = source,
            omit = omit,
            include = include,
            debug = debug,
            )

        if 'debug' in options.actions:
            return self.do_debug(args)

        if 'erase' in options.actions or options.erase_first:
            self.coverage.erase()
        else:
            self.coverage.load()

        if 'execute' in options.actions:
            self.do_execute(options, args)

        if 'combine' in options.actions:
            self.coverage.combine()
            self.coverage.save()

        # Remaining actions are reporting, with some common options.
        report_args = dict(
            morfs = args,
            ignore_errors = options.ignore_errors,
            omit = omit,
            include = include,
            )

        if 'report' in options.actions:
            total = self.coverage.report(
                show_missing=options.show_missing, **report_args)
        if 'annotate' in options.actions:
            self.coverage.annotate(
                directory=options.directory, **report_args)
        if 'html' in options.actions:
            total = self.coverage.html_report(
                directory=options.directory, title=options.title,
                **report_args)
        if 'xml' in options.actions:
            outfile = options.outfile
            total = self.coverage.xml_report(outfile=outfile, **report_args)

        if options.fail_under is not None:
            if total >= options.fail_under:
                return OK
            else:
                return FAIL_UNDER
        else:
            return OK
def command_line ( self , argv ) : # Collect the command-line options. if not argv : self . help_fn ( topic = 'minimum_help' ) return OK # The command syntax we parse depends on the first argument.  Classic # syntax always starts with an option. self . classic = argv [ 0 ] . startswith ( '-' ) if self . classic : parser = ClassicOptionParser ( ) else : parser = CMDS . get ( argv [ 0 ] ) if not parser : self . help_fn ( "Unknown command: '%s'" % argv [ 0 ] ) return ERR argv = argv [ 1 : ] parser . help_fn = self . help_fn ok , options , args = parser . parse_args ( argv ) if not ok : return ERR # Handle help and version. if self . do_help ( options , args , parser ) : return OK # Check for conflicts and problems in the options. if not self . args_ok ( options , args ) : return ERR # Listify the list options. source = unshell_list ( options . source ) omit = unshell_list ( options . omit ) include = unshell_list ( options . include ) debug = unshell_list ( options . debug ) # Do something. self . coverage = self . covpkg . coverage ( data_suffix = options . parallel_mode , cover_pylib = options . pylib , timid = options . timid , branch = options . branch , config_file = options . rcfile , source = source , omit = omit , include = include , debug = debug , ) if 'debug' in options . actions : return self . do_debug ( args ) if 'erase' in options . actions or options . erase_first : self . coverage . erase ( ) else : self . coverage . load ( ) if 'execute' in options . actions : self . do_execute ( options , args ) if 'combine' in options . actions : self . coverage . combine ( ) self . coverage . save ( ) # Remaining actions are reporting, with some common options. report_args = dict ( morfs = args , ignore_errors = options . ignore_errors , omit = omit , include = include , ) if 'report' in options . actions : total = self . coverage . report ( show_missing = options . show_missing , * * report_args ) if 'annotate' in options . actions : self . coverage . annotate ( directory = options . directory , * * report_args ) if 'html' in options . actions : total = self . coverage . html_report ( directory = options . directory , title = options . title , * * report_args ) if 'xml' in options . actions : outfile = options . outfile total = self . coverage . xml_report ( outfile = outfile , * * report_args ) if options . fail_under is not None : if total >= options . fail_under : return OK else : return FAIL_UNDER else : return OK
The bulk of the command line interface to Coverage.

        `argv` is the argument list to process.

        Returns 0 if all is well, 1 if something went wrong.
The bulk of the command line interface to Coverage .