Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: tools/telemetry/catapult_base/refactor/__init__.py

Issue 1620023002: Revert of Remove catapult_base from telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perf_cb_move
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Style-preserving Python code transforms.
6
7 This module provides components for modifying and querying Python code. They can
8 be used to build custom refactorings and linters.
9 """
10
11 import functools
12 import multiprocessing
13
14 # pylint: disable=wildcard-import
15 from catapult_base.refactor.annotated_symbol import *
16 from catapult_base.refactor.module import Module
17
18
19 def _TransformFile(transform, file_path):
20 module = Module(file_path)
21 result = transform(module)
22 module.Write()
23 return result
24
25
26 def Transform(transform, file_paths):
27 transform = functools.partial(_TransformFile, transform)
28 return multiprocessing.Pool().map(transform, file_paths)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698