From: Luke Arms Date: Thu, 1 Jul 2021 04:34:56 +0000 (+1000) Subject: Match whitespace explicitly in property name X-Git-Tag: 1.12~4^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c1c074ab894f517d4f5194de3359c213e50fb9f0;p=deb_pkgs%2Fautorandr.git Match whitespace explicitly in property name Also: - Include additional properties --- diff --git a/autorandr.py b/autorandr.py index c1bdd19..f47a994 100755 --- a/autorandr.py +++ b/autorandr.py @@ -71,6 +71,11 @@ properties = [ "Broadcast RGB", "audio", "non-desktop", + "TearFree", + "underscan vborder", + "underscan hborder", + "underscan", + "scaling mode", ] help_text = """ @@ -161,7 +166,7 @@ class XrandrOutput(object): XRANDR_PROPERTIES_REGEXP = "|".join( [r"{}:\s*(?P<{}>[\S ]*\S+)" - .format(p, re.sub(r"\W+", "_", p.lower())) + .format(re.sub(r"\s", r"\\\g<0>", p), re.sub(r"\W+", "_", p.lower())) for p in properties]) # This regular expression is used to parse an output in `xrandr --verbose'