"Return the command line parameters in the configuration file format"
@property
def option_string(self):
"Return the command line parameters in the configuration file format"
- return "\n".join([" ".join(option) if option[1] else option[0] for option in chain((("output", self.output),), sorted(self.filtered_options.items()))])
+ return "\n".join([" ".join(option) if option[1] else option[0] for option in chain((("output", self.output),), sorted(self.filtered_options.items()))])
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
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
+
def xrandr_version():
"Return the version of XRandR that this system uses"
if getattr(xrandr_version, "version", False) is False:
def xrandr_version():
"Return the version of XRandR that this system uses"
if getattr(xrandr_version, "version", False) is False:
- common_resolution = [ set(( ( mode["width"], mode["height"] ) for mode in output_modes )) for output, output_modes in modes.items() if configuration[output].edid ]
+ common_resolution = [set(((mode["width"], mode["height"]) for mode in output_modes)) for output, output_modes in modes.items() if configuration[output].edid]
common_resolution = reduce(lambda a, b: a & b, common_resolution[1:], common_resolution[0])
common_resolution = reduce(lambda a, b: a & b, common_resolution[1:], common_resolution[0])
if output in modes and configuration[output].edid:
if common_resolution:
for output in configuration:
configuration[output].options = {}
if output in modes and configuration[output].edid:
- configuration[output].options["mode"] = [ x["name"] for x in sorted(modes[output], key=lambda x: 0 if x["preferred"] else 1) if x["width"] == common_resolution[-1][0] and x["height"] == common_resolution[-1][1] ][0]
+ configuration[output].options["mode"] = [x["name"] for x in sorted(modes[output], key=lambda x: 0 if x["preferred"] else 1) if x["width"] == common_resolution[-1][0] and x["height"] == common_resolution[-1][1]][0]
- if options["--save"] in ( x[0] for x in virtual_profiles ):
+ if options["--save"] in (x[0] for x in virtual_profiles):
raise AutorandrException("Cannot save current configuration as profile '%s':\nThis configuration name is a reserved virtual configuration." % options["--save"])
raise AutorandrException("Cannot save current configuration as profile '%s':\nThis configuration name is a reserved virtual configuration." % options["--save"])