libv8 5.3.332.38.5 → 5.6.326.50.0beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +2 -0
- data/ext/libv8/builder.rb +2 -2
- data/lib/libv8/version.rb +1 -1
- data/patches/0001-Build-a-standalone-static-library.patch +4 -4
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
- data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
- data/vendor/depot_tools/.gitignore +4 -0
- data/vendor/depot_tools/OWNERS +0 -2
- data/vendor/depot_tools/PRESUBMIT.py +20 -23
- data/vendor/depot_tools/README.gclient.md +3 -3
- data/vendor/depot_tools/README.git-cl.md +13 -12
- data/vendor/depot_tools/README.md +2 -3
- data/vendor/depot_tools/WATCHLISTS +0 -1
- data/vendor/depot_tools/appengine_mapper.py +23 -0
- data/vendor/depot_tools/apply_issue.py +2 -8
- data/vendor/depot_tools/bootstrap/win/README.md +1 -8
- data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
- data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/checkout.py +20 -433
- data/vendor/depot_tools/cipd +73 -0
- data/vendor/depot_tools/cipd.bat +12 -0
- data/vendor/depot_tools/cipd.ps1 +57 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/clang_format.py +9 -6
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
- data/vendor/depot_tools/codereview.settings +3 -2
- data/vendor/depot_tools/commit_queue.py +1 -1
- data/vendor/depot_tools/cpplint.py +2 -0
- data/vendor/depot_tools/fetch.py +1 -54
- data/vendor/depot_tools/fetch_configs/android.py +2 -2
- data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
- data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
- data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
- data/vendor/depot_tools/fetch_configs/dart.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
- data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
- data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
- data/vendor/depot_tools/fetch_configs/infra.py +2 -2
- data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
- data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
- data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
- data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
- data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
- data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
- data/vendor/depot_tools/fetch_configs/v8.py +2 -3
- data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
- data/vendor/depot_tools/fix_encoding.py +6 -6
- data/vendor/depot_tools/gclient.py +136 -368
- data/vendor/depot_tools/gclient_scm.py +108 -647
- data/vendor/depot_tools/gclient_utils.py +22 -86
- data/vendor/depot_tools/gerrit_client.py +105 -0
- data/vendor/depot_tools/gerrit_util.py +174 -67
- data/vendor/depot_tools/git-crrev-parse +6 -7
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git_cache.py +68 -18
- data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
- data/vendor/depot_tools/git_cl.py +1028 -961
- data/vendor/depot_tools/git_common.py +2 -3
- data/vendor/depot_tools/git_drover.py +0 -1
- data/vendor/depot_tools/git_footers.py +3 -43
- data/vendor/depot_tools/git_rebase_update.py +9 -1
- data/vendor/depot_tools/git_squash_branch.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +8 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +3 -11
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
- data/vendor/depot_tools/man/html/git-drover.html +17 -17
- data/vendor/depot_tools/man/html/git-footers.html +2 -2
- data/vendor/depot_tools/man/html/git-freeze.html +4 -4
- data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +2 -2
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
- data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-retry.html +3 -3
- data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
- data/vendor/depot_tools/man/html/git-thaw.html +2 -2
- data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
- data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
- data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map.1 +4 -4
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
- data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
- data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
- data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
- data/vendor/depot_tools/man/src/git-retry.txt +1 -1
- data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
- data/vendor/depot_tools/my_activity.py +6 -3
- data/vendor/depot_tools/my_reviews.py +1 -1
- data/vendor/depot_tools/ninja +2 -2
- data/vendor/depot_tools/ninja-linux32 +0 -0
- data/vendor/depot_tools/ninja-linux64 +0 -0
- data/vendor/depot_tools/ninja-mac +0 -0
- data/vendor/depot_tools/ninja.exe +0 -0
- data/vendor/depot_tools/owners.py +14 -3
- data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
- data/vendor/depot_tools/presubmit_support.py +109 -371
- data/vendor/depot_tools/pylintrc +83 -56
- data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
- data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
- data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
- data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
- data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
- data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
- data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
- data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
- data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
- data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
- data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
- data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
- data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
- data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
- data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
- data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
- data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
- data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
- data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
- data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
- data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
- data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
- data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
- data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
- data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
- data/vendor/depot_tools/recipes.py +52 -28
- data/vendor/depot_tools/repo +216 -69
- data/vendor/depot_tools/rietveld.py +20 -15
- data/vendor/depot_tools/roll_dep.py +1 -1
- data/vendor/depot_tools/scm.py +11 -826
- data/vendor/depot_tools/subprocess2.py +5 -5
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
- data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
- data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
- data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
- data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
- data/vendor/depot_tools/third_party/upload.py +44 -24
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
- metadata +38 -93
- data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
- data/vendor/depot_tools/git-auto-svn +0 -6
- data/vendor/depot_tools/git_auto_svn.py +0 -122
- data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
- data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
- data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
- data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
- data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
- data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
- data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
- data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
- data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
- data/vendor/depot_tools/third_party/gsutil/README +0 -38
- data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
- data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
- data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
- data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
- data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
- data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
- data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
- data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
- data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
- data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
- data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
- data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
- data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
- data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
- data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
- data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
- data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
- data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
- data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
- data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
- data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
- data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -1,30 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
# This code implements a no-op auth plugin, which allows users to use
|
16
|
-
# gsutil for accessing publicly readable buckets and objects without first
|
17
|
-
# signing up for an account.
|
18
|
-
|
19
|
-
from boto.auth_handler import AuthHandler
|
20
|
-
|
21
|
-
|
22
|
-
class NoOpAuth(AuthHandler):
|
23
|
-
|
24
|
-
capability = ['s3']
|
25
|
-
|
26
|
-
def __init__(self, path, config, provider):
|
27
|
-
pass
|
28
|
-
|
29
|
-
def add_auth(self, http_request):
|
30
|
-
pass
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
"""
|
16
|
-
Iterator wrapper that allows you to check whether the wrapped iterator
|
17
|
-
is empty and whether it has more than 1 element.
|
18
|
-
"""
|
19
|
-
|
20
|
-
class PluralityCheckableIterator(object):
|
21
|
-
|
22
|
-
def __init__(self, it):
|
23
|
-
self.it = it.__iter__()
|
24
|
-
self.head = []
|
25
|
-
# Populate first 2 elems into head so we can check whether iterator has
|
26
|
-
# more than 1 item.
|
27
|
-
for i in range(0, 2):
|
28
|
-
self.__populate_head__()
|
29
|
-
|
30
|
-
def __populate_head__(self):
|
31
|
-
try:
|
32
|
-
e = self.it.next()
|
33
|
-
self.underlying_iter_empty = False
|
34
|
-
self.head.append(e)
|
35
|
-
except StopIteration:
|
36
|
-
# Indicates we can no longer call next() on underlying iterator, but
|
37
|
-
# there could still be elements left to iterate in head.
|
38
|
-
self.underlying_iter_empty = True
|
39
|
-
|
40
|
-
def __iter__(self):
|
41
|
-
while len(self.head) > 0:
|
42
|
-
yield self.next()
|
43
|
-
else:
|
44
|
-
raise StopIteration()
|
45
|
-
|
46
|
-
def next(self):
|
47
|
-
# Backfill into head each time we pop an element so we can always check
|
48
|
-
# for emptiness and for has_plurality().
|
49
|
-
self.__populate_head__()
|
50
|
-
return self.head.pop(0)
|
51
|
-
|
52
|
-
def is_empty(self):
|
53
|
-
return len(self.head) == 0
|
54
|
-
|
55
|
-
def has_plurality(self):
|
56
|
-
return len(self.head) > 1
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
import boto
|
16
|
-
|
17
|
-
from gslib.exception import ProjectIdException
|
18
|
-
from gslib.wildcard_iterator import WILDCARD_BUCKET_ITERATOR
|
19
|
-
|
20
|
-
GOOG_PROJ_ID_HDR = 'x-goog-project-id'
|
21
|
-
|
22
|
-
|
23
|
-
class ProjectIdHandler(object):
|
24
|
-
"""Google Project ID header handling."""
|
25
|
-
|
26
|
-
def __init__(self):
|
27
|
-
"""Instantiates Project ID handler. Call after boto config file loaded."""
|
28
|
-
config = boto.config
|
29
|
-
self.project_id = config.get_value('GSUtil', 'default_project_id')
|
30
|
-
|
31
|
-
def SetProjectId(self, project_id):
|
32
|
-
"""Overrides project ID value from config file default.
|
33
|
-
|
34
|
-
Args:
|
35
|
-
project_id: Project ID to use.
|
36
|
-
"""
|
37
|
-
self.project_id = project_id
|
38
|
-
|
39
|
-
def FillInProjectHeaderIfNeeded(self, command, uri, headers):
|
40
|
-
"""Fills project ID header into headers if defined and applicable.
|
41
|
-
|
42
|
-
Args:
|
43
|
-
command: The command being run.
|
44
|
-
uri: The URI against which this command is being run.
|
45
|
-
headers: Dictionary containing optional HTTP headers to pass to boto.
|
46
|
-
Must not be None.
|
47
|
-
"""
|
48
|
-
|
49
|
-
# We only include the project ID header if it's a GS URI and a project_id
|
50
|
-
# was specified and
|
51
|
-
# (it's an 'mb', 'disablelogging, or 'enablelogging' command or
|
52
|
-
# a boto request in integration tests or
|
53
|
-
# (an 'ls' command that doesn't specify a bucket or wildcarded bucket)).
|
54
|
-
if (uri.scheme.lower() == 'gs' and self.project_id
|
55
|
-
and (command == 'mb' or command == 'disablelogging'
|
56
|
-
or command == 'enablelogging'
|
57
|
-
or command == 'test'
|
58
|
-
or (command == 'ls' and not uri.names_bucket())
|
59
|
-
or (command == WILDCARD_BUCKET_ITERATOR))):
|
60
|
-
# Note: check for None (as opposed to "not headers") here because
|
61
|
-
# it's ok to pass empty headers.
|
62
|
-
if headers is None:
|
63
|
-
raise ProjectIdException(
|
64
|
-
'FillInProjectHeaderIfNeeded called with headers=None')
|
65
|
-
headers[GOOG_PROJ_ID_HDR] = self.project_id
|
66
|
-
elif headers.has_key(GOOG_PROJ_ID_HDR):
|
67
|
-
del headers[GOOG_PROJ_ID_HDR]
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
"""
|
16
|
-
Class that holds state (bucket_storage_uri_class and debug) needed for
|
17
|
-
instantiating StorageUri objects. The StorageUri func defined in this class
|
18
|
-
uses that state plus gsutil default flag values to instantiate this frequently
|
19
|
-
constructed object with just one param for most cases.
|
20
|
-
"""
|
21
|
-
|
22
|
-
import boto
|
23
|
-
from gslib.exception import CommandException
|
24
|
-
|
25
|
-
|
26
|
-
class StorageUriBuilder(object):
|
27
|
-
|
28
|
-
def __init__(self, debug, bucket_storage_uri_class):
|
29
|
-
"""
|
30
|
-
Args:
|
31
|
-
debug: Debug level to pass in to boto connection (range 0..3).
|
32
|
-
bucket_storage_uri_class: Class to instantiate for cloud StorageUris.
|
33
|
-
Settable for testing/mocking.
|
34
|
-
"""
|
35
|
-
self.bucket_storage_uri_class = bucket_storage_uri_class
|
36
|
-
self.debug = debug
|
37
|
-
|
38
|
-
def StorageUri(self, uri_str, is_latest=False):
|
39
|
-
"""
|
40
|
-
Instantiates StorageUri using class state and gsutil default flag values.
|
41
|
-
|
42
|
-
Args:
|
43
|
-
uri_str: StorageUri naming bucket or object.
|
44
|
-
is_latest: boolean indicating whether this versioned object represents the
|
45
|
-
current version.
|
46
|
-
|
47
|
-
Returns:
|
48
|
-
boto.StorageUri for given uri_str.
|
49
|
-
|
50
|
-
Raises:
|
51
|
-
InvalidUriError: if uri_str not valid.
|
52
|
-
"""
|
53
|
-
return boto.storage_uri(
|
54
|
-
uri_str, 'file', debug=self.debug, validate=False,
|
55
|
-
bucket_storage_uri_class=self.bucket_storage_uri_class,
|
56
|
-
suppress_consec_slashes=False, is_latest=is_latest)
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
"""Basic thread pool with exception handler."""
|
16
|
-
|
17
|
-
import logging
|
18
|
-
import Queue
|
19
|
-
import threading
|
20
|
-
|
21
|
-
|
22
|
-
# Magic values used to cleanly bring down threads.
|
23
|
-
_THREAD_EXIT_MAGIC = ('Clean', 'Thread', 'Exit')
|
24
|
-
|
25
|
-
|
26
|
-
def _DefaultExceptionHandler(e):
|
27
|
-
logging.exception(e)
|
28
|
-
|
29
|
-
|
30
|
-
class Worker(threading.Thread):
|
31
|
-
"""Thread executing tasks from a given task's queue."""
|
32
|
-
|
33
|
-
def __init__(self, tasks, exception_handler):
|
34
|
-
threading.Thread.__init__(self)
|
35
|
-
self.tasks = tasks
|
36
|
-
self.daemon = True
|
37
|
-
self.exception_handler = exception_handler
|
38
|
-
self.start()
|
39
|
-
|
40
|
-
def run(self):
|
41
|
-
while True:
|
42
|
-
func, args, kargs = self.tasks.get()
|
43
|
-
|
44
|
-
# Listen for magic value indicating thread exit.
|
45
|
-
if (func, args, kargs) == _THREAD_EXIT_MAGIC:
|
46
|
-
break
|
47
|
-
|
48
|
-
try:
|
49
|
-
func(*args, **kargs)
|
50
|
-
except Exception, e:
|
51
|
-
self.exception_handler(e)
|
52
|
-
finally:
|
53
|
-
self.tasks.task_done()
|
54
|
-
|
55
|
-
|
56
|
-
class ThreadPool(object):
|
57
|
-
"""Pool of threads consuming tasks from a queue."""
|
58
|
-
|
59
|
-
def __init__(self, num_threads, exception_handler=_DefaultExceptionHandler):
|
60
|
-
self.tasks = Queue.Queue(num_threads)
|
61
|
-
self.threads = []
|
62
|
-
for _ in range(num_threads):
|
63
|
-
self.threads.append(Worker(self.tasks, exception_handler))
|
64
|
-
|
65
|
-
def AddTask(self, func, *args, **kargs):
|
66
|
-
"""Add a task to the queue."""
|
67
|
-
self.tasks.put((func, args, kargs))
|
68
|
-
|
69
|
-
def WaitCompletion(self):
|
70
|
-
"""Wait for completion of all the tasks in the queue."""
|
71
|
-
self.tasks.join()
|
72
|
-
|
73
|
-
def Shutdown(self):
|
74
|
-
"""Shutdown the thread pool."""
|
75
|
-
for thread in self.threads:
|
76
|
-
self.tasks.put(_THREAD_EXIT_MAGIC)
|
77
|
-
|
78
|
-
for thread in self.threads:
|
79
|
-
thread.join()
|
@@ -1,167 +0,0 @@
|
|
1
|
-
# Copyright 2010 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
"""Static data and helper functions."""
|
16
|
-
|
17
|
-
import math
|
18
|
-
import re
|
19
|
-
import os
|
20
|
-
import sys
|
21
|
-
import time
|
22
|
-
|
23
|
-
import boto
|
24
|
-
from third_party.retry_decorator.decorators import retry
|
25
|
-
|
26
|
-
# We don't use the oauth2 authentication plugin directly; importing it here
|
27
|
-
# ensures that it's loaded and available by default. Note: we made this static
|
28
|
-
# state instead of Command instance state because the top-level gsutil code
|
29
|
-
# needs to check it.
|
30
|
-
HAVE_OAUTH2 = False
|
31
|
-
try:
|
32
|
-
from oauth2_plugin import oauth2_helper
|
33
|
-
HAVE_OAUTH2 = True
|
34
|
-
except ImportError:
|
35
|
-
pass
|
36
|
-
|
37
|
-
TWO_MB = 2 * 1024 * 1024
|
38
|
-
|
39
|
-
NO_MAX = sys.maxint
|
40
|
-
|
41
|
-
# Binary exponentiation strings.
|
42
|
-
_EXP_STRINGS = [
|
43
|
-
(0, 'B', 'bit'),
|
44
|
-
(10, 'KB', 'kbit'),
|
45
|
-
(20, 'MB', 'Mbit'),
|
46
|
-
(30, 'GB', 'Gbit'),
|
47
|
-
(40, 'TB', 'Tbit'),
|
48
|
-
(50, 'PB', 'Pbit'),
|
49
|
-
]
|
50
|
-
|
51
|
-
# Detect platform types.
|
52
|
-
IS_WINDOWS = 'win32' in str(sys.platform).lower()
|
53
|
-
IS_LINUX = 'linux' in str(sys.platform).lower()
|
54
|
-
IS_OSX = 'darwin' in str(sys.platform).lower()
|
55
|
-
|
56
|
-
Retry = retry
|
57
|
-
|
58
|
-
# Enum class for specifying listing style.
|
59
|
-
class ListingStyle(object):
|
60
|
-
SHORT = 'SHORT'
|
61
|
-
LONG = 'LONG'
|
62
|
-
LONG_LONG = 'LONG_LONG'
|
63
|
-
|
64
|
-
|
65
|
-
def HasConfiguredCredentials(bypass_prodaccess):
|
66
|
-
"""Determines if boto credential/config file exists."""
|
67
|
-
config = boto.config
|
68
|
-
has_goog_creds = (config.has_option('Credentials', 'gs_access_key_id') and
|
69
|
-
config.has_option('Credentials', 'gs_secret_access_key'))
|
70
|
-
has_amzn_creds = (config.has_option('Credentials', 'aws_access_key_id') and
|
71
|
-
config.has_option('Credentials', 'aws_secret_access_key'))
|
72
|
-
has_oauth_creds = (HAVE_OAUTH2 and
|
73
|
-
config.has_option('Credentials', 'gs_oauth2_refresh_token'))
|
74
|
-
has_auth_plugins = config.has_option('Plugin', 'plugin_directory')
|
75
|
-
# Pretend prodaccess doesn't exist if --bypass_prodaccess is passed in.
|
76
|
-
has_prodaccess = HasExecutable('prodaccess') and not bypass_prodaccess
|
77
|
-
return (has_goog_creds or has_amzn_creds or has_oauth_creds
|
78
|
-
or has_auth_plugins or has_prodaccess)
|
79
|
-
|
80
|
-
|
81
|
-
def _RoundToNearestExponent(num):
|
82
|
-
i = 0
|
83
|
-
while i+1 < len(_EXP_STRINGS) and num >= (2 ** _EXP_STRINGS[i+1][0]):
|
84
|
-
i += 1
|
85
|
-
return i, round(float(num) / 2 ** _EXP_STRINGS[i][0], 2)
|
86
|
-
|
87
|
-
def MakeHumanReadable(num):
|
88
|
-
"""Generates human readable string for a number of bytes.
|
89
|
-
|
90
|
-
Args:
|
91
|
-
num: The number, in bytes.
|
92
|
-
|
93
|
-
Returns:
|
94
|
-
A string form of the number using size abbreviations (KB, MB, etc.).
|
95
|
-
"""
|
96
|
-
i, rounded_val = _RoundToNearestExponent(num)
|
97
|
-
return '%s %s' % (rounded_val, _EXP_STRINGS[i][1])
|
98
|
-
|
99
|
-
def MakeBitsHumanReadable(num):
|
100
|
-
"""Generates human readable string for a number of bits.
|
101
|
-
|
102
|
-
Args:
|
103
|
-
num: The number, in bits.
|
104
|
-
|
105
|
-
Returns:
|
106
|
-
A string form of the number using bit size abbreviations (kbit, Mbit, etc.)
|
107
|
-
"""
|
108
|
-
i, rounded_val = _RoundToNearestExponent(num)
|
109
|
-
return '%s %s' % (rounded_val, _EXP_STRINGS[i][2])
|
110
|
-
|
111
|
-
def Percentile(values, percent, key=lambda x:x):
|
112
|
-
"""Find the percentile of a list of values.
|
113
|
-
|
114
|
-
Taken from: http://code.activestate.com/recipes/511478/
|
115
|
-
|
116
|
-
Args:
|
117
|
-
values: a list of numeric values. Note that the values MUST BE already
|
118
|
-
sorted.
|
119
|
-
percent: a float value from 0.0 to 1.0.
|
120
|
-
key: optional key function to compute value from each element of the list
|
121
|
-
of values.
|
122
|
-
|
123
|
-
Returns:
|
124
|
-
The percentile of the values.
|
125
|
-
"""
|
126
|
-
if not values:
|
127
|
-
return None
|
128
|
-
k = (len(values) - 1) * percent
|
129
|
-
f = math.floor(k)
|
130
|
-
c = math.ceil(k)
|
131
|
-
if f == c:
|
132
|
-
return key(values[int(k)])
|
133
|
-
d0 = key(values[int(f)]) * (c-k)
|
134
|
-
d1 = key(values[int(c)]) * (k-f)
|
135
|
-
return d0 + d1
|
136
|
-
|
137
|
-
def ExtractErrorDetail(e):
|
138
|
-
"""Extract <Details> text from XML content.
|
139
|
-
|
140
|
-
Args:
|
141
|
-
e: The GSResponseError that includes XML to be parsed.
|
142
|
-
|
143
|
-
Returns:
|
144
|
-
(exception_name, d), where d is <Details> text or None if not found.
|
145
|
-
"""
|
146
|
-
exc_name_parts = re.split("[\.']", str(type(e)))
|
147
|
-
if len(exc_name_parts) < 2:
|
148
|
-
# Shouldn't happen, but have fallback in case.
|
149
|
-
exc_name = str(type(e))
|
150
|
-
else:
|
151
|
-
exc_name = exc_name_parts[-2]
|
152
|
-
if not hasattr(e, 'body'):
|
153
|
-
return (exc_name, None)
|
154
|
-
detail_start = e.body.find('<Details>')
|
155
|
-
detail_end = e.body.find('</Details>')
|
156
|
-
if detail_start != -1 and detail_end != -1:
|
157
|
-
return (exc_name, e.body[detail_start+9:detail_end])
|
158
|
-
return (exc_name, None)
|
159
|
-
|
160
|
-
|
161
|
-
def HasExecutable(filename):
|
162
|
-
"""Determines if an executable is available on the system."""
|
163
|
-
for path in os.environ['PATH'].split(os.pathsep):
|
164
|
-
exe_file = os.path.join(path, filename)
|
165
|
-
if os.path.exists(exe_file) and os.access(exe_file, os.X_OK):
|
166
|
-
return True
|
167
|
-
return False
|