eric7/DebugClients/Python/coverage/config.py

branch
eric7
changeset 8527
2bd1325d727e
parent 8312
800c432b34c8
child 8775
0802ae193343
diff -r 587202572b10 -r 2bd1325d727e eric7/DebugClients/Python/coverage/config.py
--- a/eric7/DebugClients/Python/coverage/config.py	Fri Aug 20 19:56:17 2021 +0200
+++ b/eric7/DebugClients/Python/coverage/config.py	Sat Aug 21 14:21:44 2021 +0200
@@ -63,7 +63,7 @@
             real_section = section_prefix + section
             if configparser.RawConfigParser.has_section(self, real_section):
                 return configparser.RawConfigParser.options(self, real_section)
-        raise configparser.NoSectionError
+        raise configparser.NoSectionError(section)
 
     def get_section(self, section):
         """Get the contents of a section, as a dictionary."""
@@ -87,7 +87,7 @@
             if configparser.RawConfigParser.has_option(self, real_section, option):
                 break
         else:
-            raise configparser.NoOptionError
+            raise configparser.NoOptionError(option, section)
 
         v = configparser.RawConfigParser.get(self, real_section, option, *args, **kwargs)
         v = substitute_variables(v, os.environ)
@@ -217,6 +217,8 @@
         # Defaults for [html]
         self.extra_css = None
         self.html_dir = "htmlcov"
+        self.html_skip_covered = None
+        self.html_skip_empty = None
         self.html_title = "Coverage report"
         self.show_contexts = False
 
@@ -384,6 +386,8 @@
         # [html]
         ('extra_css', 'html:extra_css'),
         ('html_dir', 'html:directory'),
+        ('html_skip_covered', 'html:skip_covered', 'boolean'),
+        ('html_skip_empty', 'html:skip_empty', 'boolean'),
         ('html_title', 'html:title'),
         ('show_contexts', 'html:show_contexts', 'boolean'),
 
@@ -473,6 +477,20 @@
         # If we get here, we didn't find the option.
         raise CoverageException("No such option: %r" % option_name)
 
+    def post_process_file(self, path):
+        """Make final adjustments to a file path to make it usable."""
+        return os.path.expanduser(path)
+
+    def post_process(self):
+        """Make final adjustments to settings to make them usable."""
+        self.data_file = self.post_process_file(self.data_file)
+        self.html_dir = self.post_process_file(self.html_dir)
+        self.xml_output = self.post_process_file(self.xml_output)
+        self.paths = collections.OrderedDict(
+            (k, [self.post_process_file(f) for f in v])
+            for k, v in self.paths.items()
+        )
+
 
 def config_files_to_try(config_file):
     """What config files should we try to read?
@@ -547,12 +565,6 @@
 
     # Once all the config has been collected, there's a little post-processing
     # to do.
-    config.data_file = os.path.expanduser(config.data_file)
-    config.html_dir = os.path.expanduser(config.html_dir)
-    config.xml_output = os.path.expanduser(config.xml_output)
-    config.paths = collections.OrderedDict(
-        (k, [os.path.expanduser(f) for f in v])
-        for k, v in config.paths.items()
-    )
+    config.post_process()
 
     return config

eric ide

mercurial