diff options
Diffstat (limited to 'Tools/px4params')
-rw-r--r-- | Tools/px4params/scanner.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Tools/px4params/scanner.py b/Tools/px4params/scanner.py index 8779b7bbf..43fd35e60 100644 --- a/Tools/px4params/scanner.py +++ b/Tools/px4params/scanner.py @@ -8,20 +8,15 @@ class Scanner(object): to the Parser. """ - re_file_extension = re.compile(r'\.([^\.]+)$') - def ScanDir(self, srcdir, parser): """ Scans provided path and passes all found contents to the parser using parser.Parse method. """ - extensions = set(parser.GetSupportedExtensions()) + extensions = tuple(parser.GetSupportedExtensions()) for dirname, dirnames, filenames in os.walk(srcdir): for filename in filenames: - m = self.re_file_extension.search(filename) - if m: - ext = m.group(1) - if ext in extensions: + if filename.endswith(extensions): path = os.path.join(dirname, filename) self.ScanFile(path, parser) |