| 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
|
|
|