scanners.reverse()
for scanner in scanners:
for k in scanner.get_skeys(self):
+ if self['PLATFORM'] == 'win32':
+ k = string.lower(k)
result[k] = scanner
self._memo['_gsm'] = result
def get_scanner(self, skey):
"""Find the appropriate scanner given a key (usually a file suffix).
"""
+ if self['PLATFORM'] == 'win32':
+ skey = string.lower(skey)
return self._gsm().get(skey)
def scanner_map_delete(self, kw=None):
s = map(env.get_scanner, suffixes)
assert s == [s1, s1, None, s3, s3], s
+ # Verify behavior of case-insensitive suffix matches on Windows.
+ uc_suffixes = map(string.upper, suffixes)
+
+ env = Environment(SCANNERS = [s1, s2, s3],
+ PLATFORM = 'linux')
+
+ s = map(env.get_scanner, suffixes)
+ assert s == [s1, s1, None, s2, s3], s
+
+ s = map(env.get_scanner, uc_suffixes)
+ assert s == [None, None, None, None, None], s
+
+ env['PLATFORM'] = 'win32'
+
+ s = map(env.get_scanner, uc_suffixes)
+ assert s == [s1, s1, None, s2, s3], s
+
def test_ENV(self):
"""Test setting the external ENV in Environments
"""