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

Side by Side Diff: chrome/test/chromedriver/util.py

Issue 1844743002: [chromedriver] Only delete temp files that start with "chromedriver_". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « chrome/test/chromedriver/run_buildbot_steps.py ('k') | 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 """Generic utilities for all python scripts.""" 5 """Generic utilities for all python scripts."""
6 6
7 import atexit 7 import atexit
8 import httplib 8 import httplib
9 import os 9 import os
10 import signal 10 import signal
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 The temporary directory is automatically deleted when the python interpreter 80 The temporary directory is automatically deleted when the python interpreter
81 exits normally. 81 exits normally.
82 82
83 Args: 83 Args:
84 parent_dir: the directory to create the temp dir in. If None, the system 84 parent_dir: the directory to create the temp dir in. If None, the system
85 temp dir is used. 85 temp dir is used.
86 86
87 Returns: 87 Returns:
88 The absolute path to the temporary directory. 88 The absolute path to the temporary directory.
89 """ 89 """
90 path = tempfile.mkdtemp(dir=parent_dir) 90 path = tempfile.mkdtemp(prefix='chromedriver_', dir=parent_dir)
91 atexit.register(MaybeDelete, path) 91 atexit.register(MaybeDelete, path)
92 return path 92 return path
93 93
94 94
95 def Zip(path): 95 def Zip(path):
96 """Zips the given path and returns the zipped file.""" 96 """Zips the given path and returns the zipped file."""
97 zip_path = os.path.join(MakeTempDir(), 'build.zip') 97 zip_path = os.path.join(MakeTempDir(), 'build.zip')
98 f = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) 98 f = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
99 f.write(path, os.path.basename(path)) 99 f.write(path, os.path.basename(path))
100 f.close() 100 f.close()
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 193
194 def AddLink(label, url): 194 def AddLink(label, url):
195 """Adds a link with name |label| linking to |url| to current buildbot step. 195 """Adds a link with name |label| linking to |url| to current buildbot step.
196 196
197 Args: 197 Args:
198 label: A string with the name of the label. 198 label: A string with the name of the label.
199 url: A string of the URL. 199 url: A string of the URL.
200 """ 200 """
201 print '@@@STEP_LINK@%s@%s@@@' % (label, url) 201 print '@@@STEP_LINK@%s@%s@@@' % (label, url)
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/run_buildbot_steps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698