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

Unified Diff: pylib/gyp/ninja_syntax.py

Issue 10312002: Merge latest ninja_syntax.py from upstream. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 8 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: pylib/gyp/ninja_syntax.py
===================================================================
--- pylib/gyp/ninja_syntax.py (revision 1349)
+++ pylib/gyp/ninja_syntax.py (working copy)
@@ -58,8 +58,8 @@
variables=None):
outputs = self._as_list(outputs)
all_inputs = self._as_list(inputs)[:]
- out_outputs = map(escape_spaces, outputs)
- all_inputs = map(escape_spaces, all_inputs)
+ out_outputs = list(map(escape_spaces, outputs))
+ all_inputs = list(map(escape_spaces, all_inputs))
if implicit:
implicit = map(escape_spaces, self._as_list(implicit))
@@ -75,7 +75,12 @@
' '.join(all_inputs)))
if variables:
- for key, val in variables:
+ if isinstance(variables, dict):
+ iterator = variables.iteritems()
+ else:
+ iterator = iter(variables)
+
+ for key, val in iterator:
self.variable(key, val, indent=1)
return outputs
@@ -101,7 +106,7 @@
def _line(self, text, indent=0):
"""Write 'text' word-wrapped at self.width characters."""
leading_space = ' ' * indent
- while len(text) > self.width:
+ while len(leading_space) + len(text) > self.width:
# The text is too wide; wrap if possible.
# Find the rightmost space that would obey our width constraint and
« 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