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

Side by Side Diff: build/gsd_storage.py

Issue 12450015: **/*.py: use /usr/bin/env to find python Base URL: https://chromium.googlesource.com/native_client/src/native_client@master
Patch Set: Created 7 years, 9 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 | « build/find_toolchain_revisions.py ('k') | build/gsd_storage_test.py » ('j') | 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/env python
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client 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 """Provide Google Storage access. 6 """Provide Google Storage access.
7 7
8 Provide an high-level interface to Google Storage. 8 Provide an high-level interface to Google Storage.
9 Operations are provided to read/write whole files and to 9 Operations are provided to read/write whole files and to
10 read/write strings. This allows google storage to be treated 10 read/write strings. This allows google storage to be treated
11 more or less like a key+value data-store. 11 more or less like a key+value data-store.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 Data from storage, or None for failure. 146 Data from storage, or None for failure.
147 """ 147 """
148 work_dir = tempfile.mkdtemp(prefix='gdstore', suffix='.tmp') 148 work_dir = tempfile.mkdtemp(prefix='gdstore', suffix='.tmp')
149 try: 149 try:
150 path = os.path.join(work_dir, 'data') 150 path = os.path.join(work_dir, 'data')
151 if self.GetFile(key, path) is not None: 151 if self.GetFile(key, path) is not None:
152 return file_tools.ReadFile(path) 152 return file_tools.ReadFile(path)
153 return None 153 return None
154 finally: 154 finally:
155 shutil.rmtree(work_dir) 155 shutil.rmtree(work_dir)
OLDNEW
« no previous file with comments | « build/find_toolchain_revisions.py ('k') | build/gsd_storage_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698