70 d = {} |
70 d = {} |
71 for opt in self.options(section): |
71 for opt in self.options(section): |
72 d[opt] = self.get(section, opt) |
72 d[opt] = self.get(section, opt) |
73 return d |
73 return d |
74 |
74 |
75 def get(self, section, option, *args, **kwargs): # pylint: disable=arguments-differ |
75 def get(self, section, option, *args, **kwargs): |
76 """Get a value, replacing environment variables also. |
76 """Get a value, replacing environment variables also. |
77 |
77 |
78 The arguments are the same as `RawConfigParser.get`, but in the found |
78 The arguments are the same as `RawConfigParser.get`, but in the found |
79 value, ``$WORD`` or ``${WORD}`` are replaced by the value of the |
79 value, ``$WORD`` or ``${WORD}`` are replaced by the value of the |
80 environment variable ``WORD``. |
80 environment variable ``WORD``. |
209 self.precision = 0 |
210 self.precision = 0 |
210 self.report_contexts = None |
211 self.report_contexts = None |
211 self.show_missing = False |
212 self.show_missing = False |
212 self.skip_covered = False |
213 self.skip_covered = False |
213 self.skip_empty = False |
214 self.skip_empty = False |
|
215 self.sort = None |
214 |
216 |
215 # Defaults for [html] |
217 # Defaults for [html] |
216 self.extra_css = None |
218 self.extra_css = None |
217 self.html_dir = "htmlcov" |
219 self.html_dir = "htmlcov" |
218 self.html_title = "Coverage report" |
220 self.html_title = "Coverage report" |
358 ('plugins', 'run:plugins', 'list'), |
360 ('plugins', 'run:plugins', 'list'), |
359 ('relative_files', 'run:relative_files', 'boolean'), |
361 ('relative_files', 'run:relative_files', 'boolean'), |
360 ('run_include', 'run:include', 'list'), |
362 ('run_include', 'run:include', 'list'), |
361 ('run_omit', 'run:omit', 'list'), |
363 ('run_omit', 'run:omit', 'list'), |
362 ('source', 'run:source', 'list'), |
364 ('source', 'run:source', 'list'), |
|
365 ('source_pkgs', 'run:source_pkgs', 'list'), |
363 ('timid', 'run:timid', 'boolean'), |
366 ('timid', 'run:timid', 'boolean'), |
364 ('_crash', 'run:_crash'), |
367 ('_crash', 'run:_crash'), |
365 |
368 |
366 # [report] |
369 # [report] |
367 ('exclude_list', 'report:exclude_lines', 'regexlist'), |
370 ('exclude_list', 'report:exclude_lines', 'regexlist'), |
419 section of the config file would be indicated with `"run:branch"`. |
422 section of the config file would be indicated with `"run:branch"`. |
420 |
423 |
421 `value` is the new value for the option. |
424 `value` is the new value for the option. |
422 |
425 |
423 """ |
426 """ |
|
427 # Special-cased options. |
|
428 if option_name == "paths": |
|
429 self.paths = value |
|
430 return |
424 |
431 |
425 # Check all the hard-coded options. |
432 # Check all the hard-coded options. |
426 for option_spec in self.CONFIG_FILE_OPTIONS: |
433 for option_spec in self.CONFIG_FILE_OPTIONS: |
427 attr, where = option_spec[:2] |
434 attr, where = option_spec[:2] |
428 if where == option_name: |
435 if where == option_name: |
446 section of the config file would be indicated with `"run:branch"`. |
453 section of the config file would be indicated with `"run:branch"`. |
447 |
454 |
448 Returns the value of the option. |
455 Returns the value of the option. |
449 |
456 |
450 """ |
457 """ |
|
458 # Special-cased options. |
|
459 if option_name == "paths": |
|
460 return self.paths |
|
461 |
451 # Check all the hard-coded options. |
462 # Check all the hard-coded options. |
452 for option_spec in self.CONFIG_FILE_OPTIONS: |
463 for option_spec in self.CONFIG_FILE_OPTIONS: |
453 attr, where = option_spec[:2] |
464 attr, where = option_spec[:2] |
454 if where == option_name: |
465 if where == option_name: |
455 return getattr(self, attr) |
466 return getattr(self, attr) |