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

Side by Side Diff: slave_utils.py

Issue 11189123: rpartiton->rpartition in slave_utils.GSUtilCopyDir (Closed) Base URL: https://src.chromium.org/chrome/trunk/tools/build/scripts/slave/
Patch Set: Created 8 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 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Functions specific to build slaves, shared by several buildbot scripts. 5 """Functions specific to build slaves, shared by several buildbot scripts.
6 """ 6 """
7 7
8 import datetime 8 import datetime
9 import glob 9 import glob
10 import os 10 import os
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 for filename in file_list: 413 for filename in file_list:
414 # Strip the base path off so we just have the relative file path. 414 # Strip the base path off so we just have the relative file path.
415 path = filename.partition(base)[2] 415 path = filename.partition(base)[2]
416 416
417 # If we have been given a destination directory, add that to the path. 417 # If we have been given a destination directory, add that to the path.
418 if dest_dir: 418 if dest_dir:
419 path = os.path.join(dest_dir, path) 419 path = os.path.join(dest_dir, path)
420 420
421 # Trim the filename and last slash off to create a destination path. 421 # Trim the filename and last slash off to create a destination path.
422 path = path.rpartiton(os.sep + os.path.basename(path))[0] 422 path = path.rpartition(os.sep + os.path.basename(path))[0]
423 423
424 # If we're on windows, we need to reverse slashes, gsutil wants posix paths. 424 # If we're on windows, we need to reverse slashes, gsutil wants posix paths.
425 if chromium_utils.IsWindows(): 425 if chromium_utils.IsWindows():
426 path = path.replace('\\', '/') 426 path = path.replace('\\', '/')
427 427
428 # Pass the file off to copy. 428 # Pass the file off to copy.
429 status = GSUtilCopyFile(filename, gs_base, path, gs_acl=gs_acl) 429 status = GSUtilCopyFile(filename, gs_base, path, gs_acl=gs_acl)
430 430
431 # Bail out on any failure. 431 # Bail out on any failure.
432 if status: 432 if status:
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 LogAndRemoveFiles(crash_path, r'^.+\.dmp$') 605 LogAndRemoveFiles(crash_path, r'^.+\.dmp$')
606 else: 606 else:
607 raise NotImplementedError( 607 raise NotImplementedError(
608 'Platform "%s" is not currently supported.' % sys.platform) 608 'Platform "%s" is not currently supported.' % sys.platform)
609 609
610 610
611 def WriteLogLines(logname, lines): 611 def WriteLogLines(logname, lines):
612 for line in lines: 612 for line in lines:
613 print '@@@STEP_LOG_LINE@%s@%s@@@' % (logname, line) 613 print '@@@STEP_LOG_LINE@%s@%s@@@' % (logname, line)
614 print '@@@STEP_LOG_END@%s@@@' % logname 614 print '@@@STEP_LOG_END@%s@@@' % logname
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