+ return self.edid_equals(other) and self.output == other.output and self.filtered_options == other.filtered_options
+
+ def verbose_diff(self, other):
+ "Compare to another XrandrOutput and return a list of human readable differences"
+ diffs = []
+ if not self.edid_equals(other):
+ diffs.append("EDID `%s' differs from `%s'" % (self.short_edid, other.short_edid))
+ if self.output != other.output:
+ diffs.append("Output name `%s' differs from `%s'" % (self.output, other.output))
+ if "off" in self.options and "off" not in other.options:
+ diffs.append("The output is disabled currently, but active in the new configuration")
+ elif "off" in other.options and "off" not in self.options:
+ diffs.append("The output is currently enabled, but inactive in the new configuration")
+ else:
+ for name in set(chain.from_iterable((self.options.keys(), other.options.keys()))):
+ if name not in other.options:
+ diffs.append("Option --%s %sis not present in the new configuration" % (name, "(= `%s') " % self.options[name] if self.options[name] else ""))
+ elif name not in self.options:
+ diffs.append("Option --%s (`%s' in the new configuration) is not present currently" % (name, other.options[name]))
+ elif self.options[name] != other.options[name]:
+ diffs.append("Option --%s %sis `%s' in the new configuration" % (name, "(= `%s') " % self.options[name] if self.options[name] else "", other.options[name]))
+ return diffs