Total Complexity | 4 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | #!/usr/bin/python |
||
6 | class FileFilter(object): |
||
7 | |||
8 | def __init__(self, dependencies=Dependencies()): |
||
9 | config = dependencies.getConfiguration() |
||
10 | self.filters = config.discover_file_extensions |
||
11 | |||
12 | def include(self, filepath): |
||
13 | """Whether the file is to be included in discovery. |
||
14 | |||
15 | Args: |
||
16 | filepath (str): The full path of the file. |
||
17 | |||
18 | Returns: |
||
19 | bool: True if the file should be included. |
||
20 | """ |
||
21 | for filt in self.filters: |
||
22 | if filt in filepath: |
||
23 | return True |
||
24 | return False |
||
25 |