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

Side by Side Diff: mojo/public/tools/mopy/gn.py

Issue 878933003: Move the apptest runner and parts of mopy to the public SDK. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « mojo/public/tools/mopy/config.py ('k') | mojo/public/tools/mopy/gn_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ 5 """
6 GN-related configuration functions, e.g., to produce a Config object from a GN 6 GN-related configuration functions, e.g., to produce a Config object from a GN
7 args.gn file). 7 args.gn file).
8 """ 8 """
9 9
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 values = {} 114 values = {}
115 with open(gn_file, "r") as f: 115 with open(gn_file, "r") as f:
116 for line in f.readlines(): 116 for line in f.readlines():
117 line = re.sub("\s*#.*", "", line) 117 line = re.sub("\s*#.*", "", line)
118 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line) 118 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line)
119 if result: 119 if result:
120 key = result.group(1) 120 key = result.group(1)
121 value = result.group(2) 121 value = result.group(2)
122 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value)) 122 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value))
123 return values 123 return values
OLDNEW
« no previous file with comments | « mojo/public/tools/mopy/config.py ('k') | mojo/public/tools/mopy/gn_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698