]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Allow wildcard matching in EDIDs
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 25 Mar 2018 10:19:03 +0000 (12:19 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 25 Mar 2018 10:19:03 +0000 (12:19 +0200)
See #100.

README.md
autorandr.py

index 3632e8d8d75c3abefedba67b54732c666eef6082..1b63cc2c11bf60dd1e08243e5085b7e032209875 100644 (file)
--- a/README.md
+++ b/README.md
@@ -199,6 +199,7 @@ running `xrandr`.
 * *2018-01-04* Fixed vertical/horizontal/clone-largest virtual profiles
 * *2018-03-07* Output all non-error messages to stdout instead of stderr
 * *2018-03-25* Add --detected and --current to filter the profile list output
+* *2018-03-25* Allow wildcard matching in EDIDs
 
 **autorandr 1.4**
 
index b363b9eb747c3fdcdc925ec363d9729b5c45e133..d54ade89fc27895153d8568fd1d3f8256b40d4ff 100755 (executable)
@@ -26,6 +26,7 @@ from __future__ import print_function
 
 import binascii
 import copy
+import fnmatch
 import getopt
 import hashlib
 import os
@@ -399,6 +400,10 @@ class XrandrOutput(object):
                 return hashlib.md5(binascii.unhexlify(other.edid)).hexdigest() == self.edid
             if len(self.edid) != 32 and len(other.edid) == 32 and not self.edid.startswith(XrandrOutput.EDID_UNAVAILABLE):
                 return hashlib.md5(binascii.unhexlify(self.edid)).hexdigest() == other.edid
+            if "*" in self.edid:
+                return fnmatch.fnmatch(other.edid, self.edid)
+            elif "*" in other.edid:
+                return fnmatch.fnmatch(self.edid, other.edid)
         return self.edid == other.edid
 
     def __ne__(self, other):