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

Unified Diff: build/gn_helpers.py

Issue 2389353004: Fix pylint warnings: build/gn_helpers.py (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | 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 2d5d9863b949e797b351789e7d0355b9b3364321..33cc5786d9e0163159f80cb6c22c9b370c16253f 100644
--- a/build/gn_helpers.py
+++ b/build/gn_helpers.py
@@ -63,7 +63,7 @@ def ToGNString(value, allow_dicts = True):
raise GNException("Unsupported type when printing to GN.")
-def FromGNString(input):
+def FromGNString(input_string):
"""Converts the input string from a GN serialized value to Python values.
For details on supported types see GNValueParser.Parse() below.
@@ -99,11 +99,11 @@ def FromGNString(input):
using string interpolation on a list (as in the top example) the embedded
strings will be quoted and escaped according to GN rules so the list can be
re-parsed to get the same result."""
- parser = GNValueParser(input)
+ parser = GNValueParser(input_string)
return parser.Parse()
-def FromGNArgs(input):
+def FromGNArgs(input_string):
"""Converts a string with a bunch of gn arg assignments into a Python dict.
Given a whitespace-separated list of
@@ -120,7 +120,7 @@ def FromGNArgs(input):
This routine is meant to handle only the simple sorts of values that
arise in parsing --args.
"""
- parser = GNValueParser(input)
+ parser = GNValueParser(input_string)
return parser.ParseArgs()
@@ -237,22 +237,22 @@ class GNValueParser(object):
raise GNException("Unexpected token: " + self.input[self.cur:])
def _ParseIdent(self):
- id = ''
+ ident = ''
next_char = self.input[self.cur]
if not next_char.isalpha() and not next_char=='_':
raise GNException("Expected an identifier: " + self.input[self.cur:])
- id += next_char
+ ident += next_char
self.cur += 1
next_char = self.input[self.cur]
while next_char.isalpha() or next_char.isdigit() or next_char=='_':
- id += next_char
+ ident += next_char
self.cur += 1
next_char = self.input[self.cur]
- return id
+ return ident
def ParseNumber(self):
self.ConsumeWhitespace()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698