From 232bd6ba9f71bdc5e6eb89948c2f464e81eedd32 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Mon, 23 Feb 2015 11:20:26 +0100 Subject: [PATCH] Enforce stable output order This is useful for automated testing --- autorandr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autorandr.py b/autorandr.py index 64e9e22..19f1a5e 100755 --- a/autorandr.py +++ b/autorandr.py @@ -145,12 +145,12 @@ class XrandrOutput(object): @property def option_vector(self): "Return the command line parameters for XRandR for this instance" - return sum([["--%s" % option[0], option[1]] if option[1] else ["--%s" % option[0]] for option in chain((("output", self.output),), self.options_with_defaults.items())], []) + return sum([["--%s" % option[0], option[1]] if option[1] else ["--%s" % option[0]] for option in chain((("output", self.output),), sorted(self.options_with_defaults.items()))], []) @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),), self.options.items())]) + return "\n".join([ " ".join(option) if option[1] else option[0] for option in chain((("output", self.output),), sorted(self.options.items()))]) @property def sort_key(self): -- 2.39.2