Index: tools/telemetry/telemetry/internal/backends/mandoline/config.py |
diff --git a/mojo/tools/mopy/config.py b/tools/telemetry/telemetry/internal/backends/mandoline/config.py |
similarity index 93% |
copy from mojo/tools/mopy/config.py |
copy to tools/telemetry/telemetry/internal/backends/mandoline/config.py |
index 4b17c2dee83a2e35e28c70bb0dce74ee7d4ed601..2ff513c1c76dc442831ee8f98540b9a4446dfe18 100644 |
--- a/mojo/tools/mopy/config.py |
+++ b/tools/telemetry/telemetry/internal/backends/mandoline/config.py |
@@ -2,6 +2,9 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+# TODO(yzshen): Once the dep manager is ready, remove this file and use the one |
+# from src/mojo/tools directly. |
+ |
import ast |
import os.path |
@@ -81,7 +84,7 @@ class Config(object): |
def _ParseGNArgs(self): |
'''Parse the gn config file from the build directory, if it exists.''' |
- TRANSLATIONS = { 'true': 'True', 'false': 'False', } |
+ TRANSLATIONS = {'true': 'True', 'false': 'False',} |
if self.values['build_dir'] is None: |
return |
gn_file = os.path.join(self.values['build_dir'], 'args.gn') |
@@ -90,8 +93,8 @@ class Config(object): |
with open(gn_file, 'r') as f: |
for line in f: |
- line = re.sub('\s*#.*', '', line) |
- result = re.match('^\s*(\w+)\s*=\s*(.*)\s*$', line) |
+ line = re.sub(r'\s*#.*', '', line) |
+ result = re.match(r'^\s*(\w+)\s*=\s*(.*)\s*$', line) |
if result: |
key = result.group(1) |
value = result.group(2) |