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

Unified Diff: tools/rebaseline.py

Issue 15660014: rebaseline.py : add self-tests (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add_rebaseline_selftest Created 7 years, 7 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 | tools/tests/rebaseline.sh » ('j') | tools/tests/rebaseline.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/rebaseline.py
===================================================================
--- tools/rebaseline.py (revision 9354)
+++ tools/rebaseline.py (working copy)
@@ -17,7 +17,6 @@
import os
import subprocess
import sys
-import tempfile
# Mapping of gm-expectations subdir (under
# https://skia.googlecode.com/svn/gm-expected/ )
@@ -76,12 +75,10 @@
os.path.exists(os.path.join(os.pardir, '.git')))
# Execute subprocess.call(), unless dry_run is True
- def _Call(self, cmd, stdout=None):
+ def _Call(self, cmd):
if self._dry_run:
print '%s' % ' '.join(cmd)
return 0
- if stdout:
- return subprocess.call(cmd, stdout=stdout)
else:
return subprocess.call(cmd)
@@ -91,14 +88,11 @@
url = ('http://skia-autogen.googlecode.com/svn/gm-actual/' +
expectations_subdir + '/' + builder_name + '/' +
expectations_subdir + '/' + infilename)
- cmd = [ 'curl', '--fail', '--silent', url ]
- temp = tempfile.NamedTemporaryFile()
Stephen White 2013/05/30 20:34:16 IIRC, the reason I used a temp file is that if the
epoger 2013/05/31 03:54:06 Thanks for the explanation... although, if you run
- ret = self._Call(cmd, stdout=temp)
+ cmd = [ 'curl', '--fail', '--silent', url, '--output', outfilename ]
+ ret = self._Call(cmd)
if ret != 0:
print '# Couldn\'t fetch ' + url
return
- cmd = [ 'cp', temp.name, outfilename ]
- self._Call(cmd);
if self._is_svn_checkout:
cmd = [ 'svn', 'add', '--quiet', outfilename ]
self._Call(cmd)
« no previous file with comments | « no previous file | tools/tests/rebaseline.sh » ('j') | tools/tests/rebaseline.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698