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

Unified Diff: build/gn_helpers.py

Issue 1618243004: Use gn_helpers to deserialize GN lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/zip.gni ('k') | components/policy/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/gn_helpers.py
diff --git a/build/gn_helpers.py b/build/gn_helpers.py
index 07a7c3e913c1ebeaa9936df9f5fd7f53af62ffe9..dc0820a62bcb12d3e3c131f463bc65893c95f58e 100644
--- a/build/gn_helpers.py
+++ b/build/gn_helpers.py
@@ -5,7 +5,19 @@
"""Helper functions useful when writing scripts that integrate with GN.
The main functions are ToGNString and FromGNString which convert between
-serialized GN veriables and Python variables."""
+serialized GN veriables and Python variables.
+
+To use in a random python file in the build:
+
+ import os
+ import sys
+
+ sys.path.append(os.path.join(os.path.dirname(__file__),
+ os.pardir, os.pardir, "build"))
+ import gn_helpers
+
+Where the sequence of parameters to join is the relative path from your source
+file to the build directory."""
class GNException(Exception):
pass
« no previous file with comments | « build/config/zip.gni ('k') | components/policy/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698