2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
10 from telemetry
.util
import path
13 def IncludeDir(dir_name
):
14 return (dir_name
[0] != '.' and dir_name
[0] != '_' and
15 not dir_name
.startswith('internal') and not dir_name
== 'third_party')
18 def IncludeFile(file_name
):
19 root
, ext
= os
.path
.splitext(file_name
)
20 return (file_name
[0] != '.' and
21 not root
.endswith('_unittest') and ext
== '.py')
24 def ListFiles(directory
):
26 for root
, dirs
, files
in os
.walk(directory
):
27 dirs
[:] = [dir_name
for dir_name
in dirs
if IncludeDir(dir_name
)]
29 os
.path
.relpath(os
.path
.join(root
, file_name
), directory
)
30 for file_name
in files
if IncludeFile(file_name
)]
31 return sorted(matching_files
)
35 modules
= ListFiles(path
.GetTelemetryDir())
39 if __name__
== '__main__':