Chromium Code Reviews| Index: tools/telemetry/count |
| diff --git a/tools/telemetry/count b/tools/telemetry/count |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..e4e7b0fdf31e3d7e855125f5d5936be2802b342d |
| --- /dev/null |
| +++ b/tools/telemetry/count |
| @@ -0,0 +1,42 @@ |
| +#! /usr/bin/env python |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import imp |
| +import inspect |
| +import os |
| + |
| +from telemetry.util import path |
| + |
| + |
| +def IncludeDir(dir_name): |
| + return (dir_name[0] != '.' and dir_name[0] != '_' and |
| + not dir_name.startswith('internal') and not dir_name == 'third_party') |
| + |
| + |
| +def IncludeFile(file_name): |
| + root, ext = os.path.splitext(file_name) |
| + return (file_name[0] != '.' and |
| + not root.endswith('_unittest') and ext == '.py') |
| + |
| + |
| +def ListFiles(directory): |
| + matching_files = [] |
| + for root, dirs, files in os.walk(directory): |
| + dirs[:] = [dir_name for dir_name in dirs if IncludeDir(dir_name)] |
| + matching_files += [ |
| + os.path.relpath(os.path.join(root, file_name), directory) |
| + for file_name in files if IncludeFile(file_name)] |
| + return sorted(matching_files) |
| + |
| + |
| +def main(): |
| + modules = ListFiles(path.GetTelemetryDir()) |
| + for module in modules: |
|
eakuefner
2015/03/03 23:58:17
TODO(dtu/eakuefner): add a -v option and re-enable
eakuefner
2015/03/04 00:00:47
Or don't.
dtu
2015/03/04 00:01:26
Done.
|
| + print module |
| + print len(modules) |
| + |
| + |
| +if __name__ == '__main__': |
| + main() |