Allow wildcard matching in EDIDs

See #100.
This commit is contained in:
Phillip Berndt 2018-03-25 12:19:03 +02:00
parent 0a57b0a8e9
commit bc032ec25e
2 changed files with 6 additions and 0 deletions

View File

@ -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**

View File

@ -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):