summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-05-31 12:22:34 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-05-31 12:22:34 -0400
commit861b299d1c0e7c60245451b0d6b4c65858be0abd (patch)
tree0cf03ac4d0f8e592c3c0c3cec88c00063140baf6 /coverage/cmdline.py
parent48c3bdb3c87e1a701c4f6b88c516232fe868dc3b (diff)
downloadpython-coveragepy-git-861b299d1c0e7c60245451b0d6b4c65858be0abd.tar.gz
Clean up the plugins more. Add the rcfile and include options. Omit can no longer be a file of omissions, use the rcfile for that.
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r--coverage/cmdline.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index a0184af8..c96bba9a 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -442,10 +442,10 @@ class CoverageScript(object):
# Listify the list options.
omit = None
if options.omit:
- omit = self.pattern_list(options.omit)
+ omit = pattern_list(options.omit)
include = None
if options.include:
- include = self.pattern_list(options.include)
+ include = pattern_list(options.include)
# Do something.
self.coverage = self.covpkg.coverage(
@@ -509,13 +509,12 @@ class CoverageScript(object):
self.coverage.save()
# Remaining actions are reporting, with some common options.
- report_args = {
- 'morfs': args,
- 'ignore_errors': options.ignore_errors,
- }
-
- report_args['omit'] = omit
- report_args['include'] = include
+ report_args = dict(
+ morfs = args,
+ ignore_errors = options.ignore_errors,
+ omit = omit,
+ include = include,
+ )
if 'report' in options.actions:
self.coverage.report(
@@ -532,16 +531,17 @@ class CoverageScript(object):
return OK
- def pattern_list(self, s):
- """Turn an argument into a list of patterns."""
- if sys.platform == 'win32':
- # When running coverage as coverage.exe, some of the behavior
- # of the shell is emulated: wildcards are expanded into a list of
- # filenames. So you have to single-quote patterns on the command
- # line, but (not) helpfully, the single quotes are included in the
- # argument, so we have to strip them off here.
- s = s.strip("'")
- return s.split(',')
+
+def pattern_list(s):
+ """Turn an argument into a list of patterns."""
+ if sys.platform == 'win32':
+ # When running coverage as coverage.exe, some of the behavior
+ # of the shell is emulated: wildcards are expanded into a list of
+ # filenames. So you have to single-quote patterns on the command
+ # line, but (not) helpfully, the single quotes are included in the
+ # argument, so we have to strip them off here.
+ s = s.strip("'")
+ return s.split(',')
HELP_TOPICS = r"""