]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Add profile name to error message when EDID is missing
authorTim Schulze-Hartung <tim.schulze-hartung@sap.com>
Fri, 28 Oct 2022 10:22:30 +0000 (12:22 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Tue, 22 Nov 2022 09:16:20 +0000 (10:16 +0100)
autorandr.py

index f22b218e7e2f5094c8572033d32f50a9ae570fe1..76f2fd79d81539c85354b1cb2926b2208fd8c3b6 100755 (executable)
@@ -466,7 +466,7 @@ class XrandrOutput(object):
         return XrandrOutput(match["output"], edid, options), modes
 
     @classmethod
-    def from_config_file(cls, edid_map, configuration):
+    def from_config_file(cls, profile, edid_map, configuration):
         "Instanciate an XrandrOutput from the contents of a configuration file"
         options = {}
         for line in configuration.split("\n"):
@@ -487,8 +487,8 @@ class XrandrOutput(object):
             if fuzzy_output in fuzzy_edid_map:
                 edid = edid_map[list(edid_map.keys())[fuzzy_edid_map.index(fuzzy_output)]]
             elif "off" not in options:
-                raise AutorandrException("Failed to find an EDID for output `%s' in setup file, required as `%s' "
-                                         "is not off in config file." % (options["output"], options["output"]))
+                raise AutorandrException("Profile `%s': Failed to find an EDID for output `%s' in setup file, required "
+                                         "as `%s' is not off in config file." % (profile, options["output"], options["output"]))
         output = options["output"]
         del options["output"]
 
@@ -634,7 +634,7 @@ def load_profiles(profile_path):
         buffer = []
         for line in chain(open(config_name).readlines(), ["output"]):
             if line[:6] == "output" and buffer:
-                config[buffer[0].strip().split()[-1]] = XrandrOutput.from_config_file(edids, "".join(buffer))
+                config[buffer[0].strip().split()[-1]] = XrandrOutput.from_config_file(profile, edids, "".join(buffer))
                 buffer = [line]
             else:
                 buffer.append(line)