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

Unified Diff: gslib/__init__.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month 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 | « VERSION ('k') | gslib/__main__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gslib/__init__.py
===================================================================
--- gslib/__init__.py (revision 33376)
+++ gslib/__init__.py (working copy)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,15 +19,30 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-
"""Package marker file."""
+from __future__ import absolute_import
+
import os
import pkgutil
import sys
+import tempfile
import gslib.exception
+coverage_outfile = os.getenv('GSUTIL_COVERAGE_OUTPUT_FILE', None)
+if coverage_outfile:
+ try:
+ import coverage # pylint: disable=g-import-not-at-top
+ coverage_controller = coverage.coverage(
+ data_file=coverage_outfile, data_suffix=True, auto_data=True,
+ source=['gslib'], omit=['gslib/third_party/*', 'gslib/tests/*',
+ tempfile.gettempdir() + '*'])
+ coverage_controller.start()
+ except ImportError:
+ pass
+
+
# Directory containing the gslib module.
GSLIB_DIR = os.path.dirname(os.path.realpath(__file__))
# Path to gsutil executable. This assumes gsutil is the running script.
@@ -69,9 +85,13 @@
PROGRAM_FILES_DIR, 'third_party', 'boto', 'tests', 'integration', 's3')
sys.path.append(mock_storage_location)
+
def _GetFileContents(filename):
"""Tries to find the given filename on disk or via pkgutil.get_data.
+ Args:
+ filename: String name of the file.
+
Returns:
A tuple containing the absolute path to the requested file and the file's
contents. If the file is not actually on disk, the file path will be None.
« no previous file with comments | « VERSION ('k') | gslib/__main__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698