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

Side by Side Diff: gclient.py

Issue 1627010: Fix a python 2.6ism (Closed)
Patch Set: Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A wrapper script to manage a set of client modules in different SCM. 6 """A wrapper script to manage a set of client modules in different SCM.
7 7
8 This script is intended to be used to help basic management of client 8 This script is intended to be used to help basic management of client
9 program sources residing in one or more Subversion modules and Git 9 program sources residing in one or more Subversion modules and Git
10 repositories, along with other modules it depends on, also in Subversion or Git, 10 repositories, along with other modules it depends on, also in Subversion or Git,
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 The .gclient_entries file lives in the same directory as .gclient. 397 The .gclient_entries file lives in the same directory as .gclient.
398 398
399 Args: 399 Args:
400 entries: A sequence of solution names. 400 entries: A sequence of solution names.
401 """ 401 """
402 # Sometimes pprint.pformat will use {', sometimes it'll use { ' ... It 402 # Sometimes pprint.pformat will use {', sometimes it'll use { ' ... It
403 # makes testing a bit too fun. 403 # makes testing a bit too fun.
404 result = pprint.pformat(entries, 2) 404 result = pprint.pformat(entries, 2)
405 if result.startswith('{\''): 405 if result.startswith('{\''):
406 result[0:2] = '{ \'' 406 result = '{ \'' + result[2:]
407 text = "entries = \\\n" + result + '\n' 407 text = "entries = \\\n" + result + '\n'
408 file_path = os.path.join(self._root_dir, self._options.entries_filename) 408 file_path = os.path.join(self._root_dir, self._options.entries_filename)
409 gclient_utils.FileWrite(file_path, text) 409 gclient_utils.FileWrite(file_path, text)
410 410
411 def _ReadEntries(self): 411 def _ReadEntries(self):
412 """Read the .gclient_entries file for the given client. 412 """Read the .gclient_entries file for the given client.
413 413
414 Args: 414 Args:
415 client: The client for which the entries file should be read. 415 client: The client for which the entries file should be read.
416 416
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1292
1293 if "__main__" == __name__: 1293 if "__main__" == __name__:
1294 try: 1294 try:
1295 result = Main(sys.argv) 1295 result = Main(sys.argv)
1296 except gclient_utils.Error, e: 1296 except gclient_utils.Error, e:
1297 print >> sys.stderr, "Error: %s" % str(e) 1297 print >> sys.stderr, "Error: %s" % str(e)
1298 result = 1 1298 result = 1
1299 sys.exit(result) 1299 sys.exit(result)
1300 1300
1301 # vim: ts=2:sw=2:tw=80:et: 1301 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« 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