'Check if the device has an interface named "MTP" using sysfs, which
avoids probing the device.'

def __call__(self, dev, debug=None):

    if (not self.ok):
        return False
    def read(x):
        try:
            with lopen(x, u'rb') as f:
                return f.read()
        except EnvironmentError:
            pass
    ipath = os.path.join(self.base, u'{0}-*/{0}-*/interface'.format(dev.busnum))
    for x in glob.glob(ipath):
        raw = read(x)
        if ((not raw) or (raw.strip() != 'MTP')):
            continue
        raw = read(os.path.join(os.path.dirname(os.path.dirname(x)), u'devnum'))
        try:
            if (raw and (int(raw) == dev.devnum)):
                if (debug is not None):
                    debug(u'Unknown    device    {0}    claims    to    be    an    MTP    device'.format(dev))
                return True
        except (ValueError, TypeError):
            continue
    return False
