diff options
Diffstat (limited to 'Tools/px4params/scanner.py')
-rw-r--r-- | Tools/px4params/scanner.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/Tools/px4params/scanner.py b/Tools/px4params/scanner.py deleted file mode 100644 index 43fd35e60..000000000 --- a/Tools/px4params/scanner.py +++ /dev/null @@ -1,30 +0,0 @@ -import os -import re -import codecs - -class Scanner(object): - """ - Traverses directory tree, reads all source files, and passes their contents - to the Parser. - """ - - def ScanDir(self, srcdir, parser): - """ - Scans provided path and passes all found contents to the parser using - parser.Parse method. - """ - extensions = tuple(parser.GetSupportedExtensions()) - for dirname, dirnames, filenames in os.walk(srcdir): - for filename in filenames: - if filename.endswith(extensions): - path = os.path.join(dirname, filename) - self.ScanFile(path, parser) - - def ScanFile(self, path, parser): - """ - Scans provided file and passes its contents to the parser using - parser.Parse method. - """ - with codecs.open(path, 'r', 'utf-8') as f: - contents = f.read() - parser.Parse(contents) |