~ubuntu-branches/ubuntu/precise/nvidia-common/precise-proposed

« back to all changes in this revision

Viewing changes to Quirks/quirkapplier.py

  • Committer: Package Import Robot
  • Author(s): Alberto Milone
  • Date: 2012-03-12 12:30:52 UTC
  • Revision ID: package-import@ubuntu.com-20120312123052-o4s60xr1ob9uy5qt
Tags: 1:0.2.41
* Add a test suite and run it at build time with dh_auto_test.
* Work correctly when the pipe symbol is used in "Match" tags.
  This symbol only worked when used in the "Handler" tag.
  Both test cases are covered in the test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
    def matches_tags(self, quirk):
67
67
        '''See if tags match system info'''
68
 
        result = True
 
68
        result = False
69
69
        for tag in quirk.match_tags.keys():
70
 
            logging.debug('Matching "%s" with value "%s"...' % (tag, quirk.match_tags[tag]))
71
 
            if (self._system_info.get(tag) != quirk.match_tags[tag]):
72
 
                logging.debug('Failure')
73
 
                return False
74
 
            logging.debug('Success')
 
70
            for val in quirk.match_tags[tag]:
 
71
                logging.debug('Matching "%s" with value "%s"...' % (tag, val))
 
72
                if (self._system_info.get(tag) == val):
 
73
                    logging.debug('Success')
 
74
                    return True
 
75
            logging.debug('Failure')
75
76
        return result
76
77
 
77
78
    def _check_quirks(self, enable=True):