libv8 7.3.492.27.1 → 8.4.255.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +11 -14
- data/CHANGELOG.md +10 -0
- data/README.md +10 -11
- data/Rakefile +30 -36
- data/ext/libv8/builder.rb +1 -1
- data/lib/libv8/version.rb +1 -1
- data/libv8.gemspec +1 -3
- data/vendor/depot_tools/{cipd.ps1 → .cipd_impl.ps1} +0 -0
- data/vendor/depot_tools/.gitattributes +1 -1
- data/vendor/depot_tools/.gitignore +7 -2
- data/vendor/depot_tools/.style.yapf +3 -1
- data/vendor/depot_tools/.vpython +55 -0
- data/vendor/depot_tools/.vpython3 +23 -0
- data/vendor/depot_tools/CROS_OWNERS +3 -1
- data/vendor/depot_tools/GOMA_OWNERS +9 -0
- data/vendor/depot_tools/LUCI_OWNERS +5 -0
- data/vendor/depot_tools/OWNERS +21 -6
- data/vendor/depot_tools/PRESUBMIT.py +35 -18
- data/vendor/depot_tools/README.git-cl.md +0 -14
- data/vendor/depot_tools/README.md +1 -1
- data/vendor/depot_tools/WATCHLISTS +2 -2
- data/vendor/depot_tools/auth.py +60 -772
- data/vendor/depot_tools/autoninja +12 -6
- data/vendor/depot_tools/autoninja.bat +14 -6
- data/vendor/depot_tools/autoninja.py +64 -27
- data/vendor/depot_tools/bb +1 -1
- data/vendor/depot_tools/bootstrap/{win/README.md → README.md} +28 -14
- data/vendor/depot_tools/bootstrap/{win/win_tools.py → bootstrap.py} +60 -43
- data/vendor/depot_tools/bootstrap/{win/git-bash.template.sh → git-bash.template.sh} +1 -1
- data/vendor/depot_tools/bootstrap/{win/git.template.bat → git.template.bat} +0 -0
- data/vendor/depot_tools/bootstrap/manifest.txt +27 -0
- data/vendor/depot_tools/bootstrap/manifest_bleeding_edge.txt +27 -0
- data/vendor/depot_tools/bootstrap/{win/profile.d.python.sh → profile.d.python.sh} +0 -0
- data/vendor/depot_tools/bootstrap/{win/python27.bleeding_edge.bat → python27.bat} +0 -0
- data/vendor/depot_tools/bootstrap/{win/python27.new.bat → python3.bat} +3 -3
- data/vendor/depot_tools/bootstrap/{win/win_tools.bat → win_tools.bat} +21 -16
- data/vendor/depot_tools/bootstrap_python3 +35 -0
- data/vendor/depot_tools/cbuildbot +1 -1
- data/vendor/depot_tools/chrome_set_ver +1 -1
- data/vendor/depot_tools/cipd +43 -39
- data/vendor/depot_tools/cipd.bat +2 -2
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_client_version.digests +15 -14
- data/vendor/depot_tools/cipd_manifest.txt +31 -8
- data/vendor/depot_tools/cipd_manifest.versions +278 -158
- data/vendor/depot_tools/cit.py +9 -7
- data/vendor/depot_tools/clang_format.py +4 -1
- data/vendor/depot_tools/clang_format_merge_driver.py +10 -8
- data/vendor/depot_tools/compile_single_file.py +7 -2
- data/vendor/depot_tools/cpplint.py +51 -45
- data/vendor/depot_tools/cros +87 -0
- data/vendor/depot_tools/cros_sdk +1 -1
- data/vendor/depot_tools/crosjobs +13 -0
- data/vendor/depot_tools/detect_host_arch.py +0 -1
- data/vendor/depot_tools/dirmd +12 -0
- data/vendor/depot_tools/dirmd.bat +7 -0
- data/vendor/depot_tools/download_from_google_storage.py +47 -27
- data/vendor/depot_tools/ensure_bootstrap +14 -0
- data/vendor/depot_tools/fetch +14 -1
- data/vendor/depot_tools/fetch.bat +14 -1
- data/vendor/depot_tools/fetch.py +5 -7
- data/vendor/depot_tools/fetch_configs/chromium.py +6 -4
- data/vendor/depot_tools/fetch_configs/devtools-frontend.py +44 -0
- data/vendor/depot_tools/fetch_configs/ios_internal.py +10 -19
- data/vendor/depot_tools/fix_encoding.py +19 -5
- data/vendor/depot_tools/gclient +28 -12
- data/vendor/depot_tools/gclient-new-workdir.py +2 -0
- data/vendor/depot_tools/gclient.bat +18 -1
- data/vendor/depot_tools/gclient.py +160 -119
- data/vendor/depot_tools/gclient_eval.py +119 -107
- data/vendor/depot_tools/gclient_paths.py +67 -57
- data/vendor/depot_tools/gclient_scm.py +181 -159
- data/vendor/depot_tools/gclient_utils.py +177 -124
- data/vendor/depot_tools/gerrit_client.py +21 -13
- data/vendor/depot_tools/gerrit_util.py +188 -228
- data/vendor/depot_tools/git-cache +1 -1
- data/vendor/depot_tools/git-cl +1 -1
- data/vendor/depot_tools/git-drover +1 -1
- data/vendor/depot_tools/git-find-releases +1 -1
- data/vendor/depot_tools/git-footers +1 -1
- data/vendor/depot_tools/git-freeze +1 -1
- data/vendor/depot_tools/git-hyper-blame +1 -1
- data/vendor/depot_tools/git-map +1 -1
- data/vendor/depot_tools/git-map-branches +1 -1
- data/vendor/depot_tools/git-mark-merge-base +1 -1
- data/vendor/depot_tools/git-nav-downstream +1 -1
- data/vendor/depot_tools/git-new-branch +1 -1
- data/vendor/depot_tools/git-number +1 -1
- data/vendor/depot_tools/git-rebase-update +1 -1
- data/vendor/depot_tools/git-rename-branch +1 -1
- data/vendor/depot_tools/git-reparent-branch +1 -1
- data/vendor/depot_tools/git-retry +1 -1
- data/vendor/depot_tools/git-squash-branch +1 -1
- data/vendor/depot_tools/git-thaw +1 -1
- data/vendor/depot_tools/git-upstream-diff +1 -1
- data/vendor/depot_tools/git_cache.py +255 -360
- data/vendor/depot_tools/git_cl.py +1562 -2059
- data/vendor/depot_tools/git_cl_completion.sh +16 -2
- data/vendor/depot_tools/git_common.py +77 -32
- data/vendor/depot_tools/git_drover.py +17 -8
- data/vendor/depot_tools/git_find_releases.py +11 -9
- data/vendor/depot_tools/git_footers.py +13 -9
- data/vendor/depot_tools/git_freezer.py +3 -1
- data/vendor/depot_tools/git_hyper_blame.py +25 -32
- data/vendor/depot_tools/git_map.py +115 -93
- data/vendor/depot_tools/git_map_branches.py +11 -10
- data/vendor/depot_tools/git_mark_merge_base.py +8 -6
- data/vendor/depot_tools/git_nav_downstream.py +9 -6
- data/vendor/depot_tools/git_new_branch.py +39 -33
- data/vendor/depot_tools/git_number.py +28 -17
- data/vendor/depot_tools/git_rebase_update.py +50 -49
- data/vendor/depot_tools/git_rename_branch.py +2 -2
- data/vendor/depot_tools/git_reparent_branch.py +8 -6
- data/vendor/depot_tools/git_upstream_diff.py +4 -2
- data/vendor/depot_tools/gn.py +6 -4
- data/vendor/depot_tools/goma_auth +12 -0
- data/vendor/depot_tools/goma_auth.bat +8 -0
- data/vendor/depot_tools/goma_ctl +12 -0
- data/vendor/depot_tools/goma_ctl.bat +8 -0
- data/vendor/depot_tools/gsutil.py +5 -2
- data/vendor/depot_tools/gsutil.py.bat +8 -0
- data/vendor/depot_tools/gsutil.vpython +3 -1
- data/vendor/depot_tools/infra/config/OWNERS +2 -2
- data/vendor/depot_tools/infra/config/recipes.cfg +3 -2
- data/vendor/depot_tools/led +1 -1
- data/vendor/depot_tools/lockfile.py +116 -0
- data/vendor/depot_tools/luci-auth +1 -1
- data/vendor/depot_tools/lucicfg +1 -1
- data/vendor/depot_tools/mac_toolchain +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +1 -1
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +31 -25
- data/vendor/depot_tools/man/html/git-cl.html +1 -1
- data/vendor/depot_tools/man/html/git-drover.html +18 -18
- data/vendor/depot_tools/man/html/git-footers.html +1 -1
- data/vendor/depot_tools/man/html/git-freeze.html +3 -3
- data/vendor/depot_tools/man/html/git-hyper-blame.html +1 -1
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +1 -1
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +1 -1
- data/vendor/depot_tools/man/html/git-nav-downstream.html +3 -3
- data/vendor/depot_tools/man/html/git-nav-upstream.html +12 -6
- data/vendor/depot_tools/man/html/git-new-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-rebase-update.html +20 -1
- data/vendor/depot_tools/man/html/git-rename-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-reparent-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-retry.html +1 -1
- data/vendor/depot_tools/man/html/git-squash-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-thaw.html +1 -1
- data/vendor/depot_tools/man/html/git-upstream-diff.html +10 -6
- data/vendor/depot_tools/man/man1/git-cl.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +21 -21
- 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 +6 -6
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +15 -9
- data/vendor/depot_tools/man/man1/git-new-branch.1 +3 -3
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +14 -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 +4 -4
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +7 -13
- data/vendor/depot_tools/man/man7/depot_tools.7 +4 -4
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +31 -25
- data/vendor/depot_tools/man/src/common_demo_functions.sh +2 -2
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +3 -3
- data/vendor/depot_tools/man/src/filter_demo_output.py +4 -2
- data/vendor/depot_tools/man/src/git-new-branch.txt +2 -1
- data/vendor/depot_tools/man/src/git-rebase-update.txt +8 -1
- data/vendor/depot_tools/metrics.README.md +8 -5
- data/vendor/depot_tools/metrics.py +7 -6
- data/vendor/depot_tools/metrics_utils.py +4 -14
- data/vendor/depot_tools/my_activity.py +85 -251
- data/vendor/depot_tools/ninja +1 -0
- data/vendor/depot_tools/ninja-mac +0 -0
- data/vendor/depot_tools/ninjalog_uploader.py +146 -145
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +69 -60
- data/vendor/depot_tools/owners.py +156 -43
- data/vendor/depot_tools/owners_finder.py +28 -14
- data/vendor/depot_tools/post_build_ninja_summary.py +76 -48
- data/vendor/depot_tools/presubmit_canned_checks.py +293 -106
- data/vendor/depot_tools/presubmit_support.py +527 -333
- data/vendor/depot_tools/prpc +1 -1
- data/vendor/depot_tools/pylint +2 -12
- data/vendor/depot_tools/pylint-1.5 +78 -0
- data/vendor/depot_tools/pylint-1.6 +78 -0
- data/vendor/depot_tools/pylint-1.7 +78 -0
- data/vendor/depot_tools/pylint-1.8 +78 -0
- data/vendor/depot_tools/pylint-1.9 +78 -0
- data/vendor/depot_tools/{depot-tools-auth.bat → pylint.bat} +2 -2
- data/vendor/depot_tools/pylint_main.py +45 -0
- data/vendor/depot_tools/pylintrc +14 -1
- data/vendor/depot_tools/python-bin/python3 +7 -0
- data/vendor/depot_tools/python_runner.sh +13 -8
- data/vendor/depot_tools/rdb +12 -0
- data/vendor/depot_tools/rdb.bat +7 -0
- data/vendor/depot_tools/recipes/OWNERS +0 -1
- data/vendor/depot_tools/recipes/README.recipes.md +218 -151
- data/vendor/depot_tools/recipes/recipe_modules/OWNERS +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +17 -16
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +127 -78
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +19 -4
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +18 -3
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +19 -4
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +28 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/input_commit_with_id_without_repo.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/multiple_patch_refs.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{with_manifest_name.json → no_cp_checkout_HEAD.json} +25 -15
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_branch_head.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_master.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/refs.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +17 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +41 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +24 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +38 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +36 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +35 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +0 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +29 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +95 -22
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +187 -114
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/do_not_retry_patch_failures_in_cq.py +42 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/__init__.py +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +2 -4
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +26 -6
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +23 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +23 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/test_api.py +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +4 -1
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +3 -1
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +2 -1
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +82 -13
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +23 -11
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +3 -4
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +3 -6
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +3 -4
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +7 -7
- data/vendor/depot_tools/recipes/recipe_modules/gclient/resources/diff_deps.py +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/test_api.py +4 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/basic.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/dont have revision yet.json +84 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/no change, exception.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/windows.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.py +88 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +9 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/sync_failure.py +24 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +2 -1
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +7 -12
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +0 -2
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +9 -17
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +3 -13
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +4 -12
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +2 -10
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +1 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +1 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +3 -10
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +3 -11
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +3 -13
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +2 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +0 -5
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/__init__.py +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +7 -13
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +21 -16
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.py +1 -2
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +23 -8
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +52 -1
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.py +15 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +32 -8
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/ancient_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/automatic_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/explicit_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +5 -4
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +21 -2
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +20 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +235 -3
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +13 -5
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.py +5 -1
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/properties.proto +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/test_api.py +19 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/execute.py +247 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/prepare.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +33 -45
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +64 -21
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +64 -21
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +1 -22
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +1 -22
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +5 -32
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py +29 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.expected/basic.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py +32 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +2 -1
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +1 -6
- data/vendor/depot_tools/recipes/recipes.py +49 -28
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +11 -6
- data/vendor/depot_tools/repo +698 -540
- data/vendor/depot_tools/roll-dep +14 -1
- data/vendor/depot_tools/roll-dep.bat +10 -1
- data/vendor/depot_tools/roll_dep.py +15 -10
- data/vendor/depot_tools/scm.py +95 -75
- data/vendor/depot_tools/setup_color.py +36 -2
- data/vendor/depot_tools/split_cl.py +44 -32
- data/vendor/depot_tools/subcommand.py +6 -6
- data/vendor/depot_tools/subprocess2.py +38 -322
- data/vendor/depot_tools/third_party/colorama/LICENSE.txt +0 -1
- data/vendor/depot_tools/third_party/colorama/README.chromium +4 -5
- data/vendor/depot_tools/third_party/colorama/README.rst +346 -0
- data/vendor/depot_tools/third_party/colorama/__init__.py +3 -4
- data/vendor/depot_tools/third_party/colorama/ansi.py +82 -30
- data/vendor/depot_tools/third_party/colorama/ansitowin32.py +105 -37
- data/vendor/depot_tools/third_party/colorama/initialise.py +39 -15
- data/vendor/depot_tools/third_party/colorama/win32.py +46 -28
- data/vendor/depot_tools/third_party/colorama/winterm.py +80 -31
- data/vendor/depot_tools/update_depot_tools +18 -8
- data/vendor/depot_tools/update_depot_tools.bat +19 -15
- data/vendor/depot_tools/upload_metrics.py +7 -6
- data/vendor/depot_tools/upload_to_google_storage.py +23 -16
- data/vendor/depot_tools/vpython +4 -4
- data/vendor/depot_tools/vpython.bat +1 -1
- data/vendor/depot_tools/vpython3 +55 -0
- data/vendor/depot_tools/vpython3.bat +12 -0
- data/vendor/depot_tools/watchlists.py +14 -11
- data/vendor/depot_tools/weekly +4 -2
- data/vendor/depot_tools/win32imports.py +61 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +49 -41
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +142 -149
- data/vendor/depot_tools/wtf +5 -3
- data/vendor/depot_tools/yapf +5 -1
- metadata +68 -343
- data/vendor/depot_tools/README.testing +0 -23
- data/vendor/depot_tools/annotated_gclient.py +0 -89
- data/vendor/depot_tools/appengine_mapper.py +0 -23
- data/vendor/depot_tools/bootstrap/win/manifest.txt +0 -20
- data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +0 -20
- data/vendor/depot_tools/bootstrap/win/pylint.new.bat +0 -7
- data/vendor/depot_tools/buildbucket.py +0 -186
- data/vendor/depot_tools/checkout.py +0 -431
- data/vendor/depot_tools/cros +0 -1
- data/vendor/depot_tools/dart_format.py +0 -58
- data/vendor/depot_tools/depot-tools-auth +0 -8
- data/vendor/depot_tools/depot-tools-auth.py +0 -102
- data/vendor/depot_tools/my_reviews.py +0 -396
- data/vendor/depot_tools/patch.py +0 -548
- data/vendor/depot_tools/pylint.py +0 -30
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +0 -239
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +0 -222
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/__init__.py +0 -4
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/api.py +0 -29
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/basic.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_linux.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_mac.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_win.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_linux.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_mac.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.py +0 -33
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +0 -66
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +0 -11
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +0 -45
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +0 -45
- data/vendor/depot_tools/rietveld.py +0 -779
- data/vendor/depot_tools/roll-dep-svn +0 -8
- data/vendor/depot_tools/roll-dep-svn.bat +0 -12
- data/vendor/depot_tools/roll_dep_svn.py +0 -430
- data/vendor/depot_tools/support/chromite_wrapper +0 -96
- data/vendor/depot_tools/third_party/boto/LICENSE +0 -18
- data/vendor/depot_tools/third_party/boto/README.chromium +0 -43
- data/vendor/depot_tools/third_party/boto/README.rst +0 -163
- data/vendor/depot_tools/third_party/boto/__init__.py +0 -793
- data/vendor/depot_tools/third_party/boto/auth.py +0 -682
- data/vendor/depot_tools/third_party/boto/auth_handler.py +0 -58
- data/vendor/depot_tools/third_party/boto/cacerts/__init__.py +0 -22
- data/vendor/depot_tools/third_party/boto/cacerts/cacerts.txt +0 -2183
- data/vendor/depot_tools/third_party/boto/compat.py +0 -28
- data/vendor/depot_tools/third_party/boto/connection.py +0 -1081
- data/vendor/depot_tools/third_party/boto/contrib/__init__.py +0 -22
- data/vendor/depot_tools/third_party/boto/contrib/ymlmessage.py +0 -52
- data/vendor/depot_tools/third_party/boto/core/README +0 -58
- data/vendor/depot_tools/third_party/boto/core/__init__.py +0 -23
- data/vendor/depot_tools/third_party/boto/core/auth.py +0 -78
- data/vendor/depot_tools/third_party/boto/core/credentials.py +0 -154
- data/vendor/depot_tools/third_party/boto/core/dictresponse.py +0 -178
- data/vendor/depot_tools/third_party/boto/core/service.py +0 -67
- data/vendor/depot_tools/third_party/boto/datapipeline/__init__.py +0 -0
- data/vendor/depot_tools/third_party/boto/datapipeline/exceptions.py +0 -42
- data/vendor/depot_tools/third_party/boto/datapipeline/layer1.py +0 -546
- data/vendor/depot_tools/third_party/boto/ecs/__init__.py +0 -90
- data/vendor/depot_tools/third_party/boto/ecs/item.py +0 -153
- data/vendor/depot_tools/third_party/boto/exception.py +0 -476
- data/vendor/depot_tools/third_party/boto/file/README +0 -49
- data/vendor/depot_tools/third_party/boto/file/__init__.py +0 -28
- data/vendor/depot_tools/third_party/boto/file/bucket.py +0 -112
- data/vendor/depot_tools/third_party/boto/file/connection.py +0 -33
- data/vendor/depot_tools/third_party/boto/file/key.py +0 -199
- data/vendor/depot_tools/third_party/boto/file/simpleresultset.py +0 -30
- data/vendor/depot_tools/third_party/boto/fps/__init__.py +0 -21
- data/vendor/depot_tools/third_party/boto/fps/connection.py +0 -369
- data/vendor/depot_tools/third_party/boto/fps/exception.py +0 -344
- data/vendor/depot_tools/third_party/boto/fps/response.py +0 -175
- data/vendor/depot_tools/third_party/boto/gs/__init__.py +0 -22
- data/vendor/depot_tools/third_party/boto/gs/acl.py +0 -304
- data/vendor/depot_tools/third_party/boto/gs/bucket.py +0 -870
- data/vendor/depot_tools/third_party/boto/gs/bucketlistresultset.py +0 -64
- data/vendor/depot_tools/third_party/boto/gs/connection.py +0 -103
- data/vendor/depot_tools/third_party/boto/gs/cors.py +0 -169
- data/vendor/depot_tools/third_party/boto/gs/key.py +0 -704
- data/vendor/depot_tools/third_party/boto/gs/resumable_upload_handler.py +0 -659
- data/vendor/depot_tools/third_party/boto/gs/user.py +0 -54
- data/vendor/depot_tools/third_party/boto/handler.py +0 -44
- data/vendor/depot_tools/third_party/boto/https_connection.py +0 -124
- data/vendor/depot_tools/third_party/boto/jsonresponse.py +0 -163
- data/vendor/depot_tools/third_party/boto/manage/__init__.py +0 -23
- data/vendor/depot_tools/third_party/boto/manage/cmdshell.py +0 -241
- data/vendor/depot_tools/third_party/boto/manage/propget.py +0 -64
- data/vendor/depot_tools/third_party/boto/manage/server.py +0 -556
- data/vendor/depot_tools/third_party/boto/manage/task.py +0 -175
- data/vendor/depot_tools/third_party/boto/manage/test_manage.py +0 -34
- data/vendor/depot_tools/third_party/boto/manage/volume.py +0 -420
- data/vendor/depot_tools/third_party/boto/mashups/__init__.py +0 -23
- data/vendor/depot_tools/third_party/boto/mashups/interactive.py +0 -97
- data/vendor/depot_tools/third_party/boto/mashups/iobject.py +0 -115
- data/vendor/depot_tools/third_party/boto/mashups/order.py +0 -211
- data/vendor/depot_tools/third_party/boto/mashups/server.py +0 -395
- data/vendor/depot_tools/third_party/boto/plugin.py +0 -90
- data/vendor/depot_tools/third_party/boto/provider.py +0 -337
- data/vendor/depot_tools/third_party/boto/pyami/__init__.py +0 -22
- data/vendor/depot_tools/third_party/boto/pyami/bootstrap.py +0 -134
- data/vendor/depot_tools/third_party/boto/pyami/config.py +0 -229
- data/vendor/depot_tools/third_party/boto/pyami/copybot.cfg +0 -60
- data/vendor/depot_tools/third_party/boto/pyami/copybot.py +0 -97
- data/vendor/depot_tools/third_party/boto/pyami/helloworld.py +0 -28
- data/vendor/depot_tools/third_party/boto/pyami/launch_ami.py +0 -178
- data/vendor/depot_tools/third_party/boto/pyami/scriptbase.py +0 -44
- data/vendor/depot_tools/third_party/boto/pyami/startup.py +0 -60
- data/vendor/depot_tools/third_party/boto/regioninfo.py +0 -63
- data/vendor/depot_tools/third_party/boto/resultset.py +0 -169
- data/vendor/depot_tools/third_party/boto/roboto/__init__.py +0 -1
- data/vendor/depot_tools/third_party/boto/roboto/awsqueryrequest.py +0 -504
- data/vendor/depot_tools/third_party/boto/roboto/awsqueryservice.py +0 -121
- data/vendor/depot_tools/third_party/boto/roboto/param.py +0 -147
- data/vendor/depot_tools/third_party/boto/s3/__init__.py +0 -84
- data/vendor/depot_tools/third_party/boto/s3/acl.py +0 -164
- data/vendor/depot_tools/third_party/boto/s3/bucket.py +0 -1634
- data/vendor/depot_tools/third_party/boto/s3/bucketlistresultset.py +0 -139
- data/vendor/depot_tools/third_party/boto/s3/bucketlogging.py +0 -83
- data/vendor/depot_tools/third_party/boto/s3/connection.py +0 -540
- data/vendor/depot_tools/third_party/boto/s3/cors.py +0 -210
- data/vendor/depot_tools/third_party/boto/s3/deletemarker.py +0 -55
- data/vendor/depot_tools/third_party/boto/s3/key.py +0 -1712
- data/vendor/depot_tools/third_party/boto/s3/keyfile.py +0 -134
- data/vendor/depot_tools/third_party/boto/s3/lifecycle.py +0 -231
- data/vendor/depot_tools/third_party/boto/s3/multidelete.py +0 -138
- data/vendor/depot_tools/third_party/boto/s3/multipart.py +0 -315
- data/vendor/depot_tools/third_party/boto/s3/prefix.py +0 -42
- data/vendor/depot_tools/third_party/boto/s3/resumable_download_handler.py +0 -339
- data/vendor/depot_tools/third_party/boto/s3/tagging.py +0 -71
- data/vendor/depot_tools/third_party/boto/s3/user.py +0 -49
- data/vendor/depot_tools/third_party/boto/s3/website.py +0 -237
- data/vendor/depot_tools/third_party/boto/services/__init__.py +0 -23
- data/vendor/depot_tools/third_party/boto/services/bs.py +0 -179
- data/vendor/depot_tools/third_party/boto/services/message.py +0 -58
- data/vendor/depot_tools/third_party/boto/services/result.py +0 -136
- data/vendor/depot_tools/third_party/boto/services/service.py +0 -161
- data/vendor/depot_tools/third_party/boto/services/servicedef.py +0 -91
- data/vendor/depot_tools/third_party/boto/services/sonofmmm.cfg +0 -43
- data/vendor/depot_tools/third_party/boto/services/sonofmmm.py +0 -81
- data/vendor/depot_tools/third_party/boto/services/submit.py +0 -88
- data/vendor/depot_tools/third_party/boto/ses/__init__.py +0 -54
- data/vendor/depot_tools/third_party/boto/ses/connection.py +0 -521
- data/vendor/depot_tools/third_party/boto/ses/exceptions.py +0 -77
- data/vendor/depot_tools/third_party/boto/storage_uri.py +0 -835
- data/vendor/depot_tools/third_party/boto/sts/__init__.py +0 -55
- data/vendor/depot_tools/third_party/boto/sts/connection.py +0 -207
- data/vendor/depot_tools/third_party/boto/sts/credentials.py +0 -215
- data/vendor/depot_tools/third_party/boto/utils.py +0 -927
- data/vendor/depot_tools/third_party/colorama/README.txt +0 -304
- data/vendor/depot_tools/third_party/fancy_urllib/README +0 -22
- data/vendor/depot_tools/third_party/fancy_urllib/__init__.py +0 -460
- data/vendor/depot_tools/third_party/logilab/README.chromium +0 -6
- data/vendor/depot_tools/third_party/logilab/__init__.py +0 -0
- data/vendor/depot_tools/third_party/logilab/astroid/LICENSE.txt +0 -340
- data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +0 -11
- data/vendor/depot_tools/third_party/logilab/astroid/__init__.py +0 -136
- data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +0 -42
- data/vendor/depot_tools/third_party/logilab/astroid/arguments.py +0 -233
- data/vendor/depot_tools/third_party/logilab/astroid/as_string.py +0 -548
- data/vendor/depot_tools/third_party/logilab/astroid/astpeephole.py +0 -86
- data/vendor/depot_tools/third_party/logilab/astroid/bases.py +0 -636
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_builtin_inference.py +0 -336
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_dateutil.py +0 -15
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_gi.py +0 -195
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_mechanize.py +0 -18
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_nose.py +0 -82
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_numpy.py +0 -62
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_pytest.py +0 -76
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_qt.py +0 -44
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_six.py +0 -288
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_ssl.py +0 -65
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_stdlib.py +0 -473
- data/vendor/depot_tools/third_party/logilab/astroid/builder.py +0 -263
- data/vendor/depot_tools/third_party/logilab/astroid/context.py +0 -81
- data/vendor/depot_tools/third_party/logilab/astroid/decorators.py +0 -75
- data/vendor/depot_tools/third_party/logilab/astroid/exceptions.py +0 -71
- data/vendor/depot_tools/third_party/logilab/astroid/inference.py +0 -359
- data/vendor/depot_tools/third_party/logilab/astroid/manager.py +0 -267
- data/vendor/depot_tools/third_party/logilab/astroid/mixins.py +0 -147
- data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +0 -741
- data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +0 -1053
- data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +0 -87
- data/vendor/depot_tools/third_party/logilab/astroid/objects.py +0 -186
- data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +0 -470
- data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +0 -390
- data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +0 -989
- data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +0 -1716
- data/vendor/depot_tools/third_party/logilab/astroid/test_utils.py +0 -201
- data/vendor/depot_tools/third_party/logilab/astroid/transforms.py +0 -96
- data/vendor/depot_tools/third_party/logilab/astroid/util.py +0 -89
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/LICENSE +0 -19
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/README.chromium +0 -11
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/__init__.py +0 -20
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/cext.c +0 -1421
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/compat.py +0 -9
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/simple.py +0 -246
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/slots.py +0 -414
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/utils.py +0 -13
- data/vendor/depot_tools/third_party/logilab/wrapt/LICENSE +0 -24
- data/vendor/depot_tools/third_party/logilab/wrapt/README.chromium +0 -11
- data/vendor/depot_tools/third_party/logilab/wrapt/__init__.py +0 -19
- data/vendor/depot_tools/third_party/logilab/wrapt/_wrappers.c +0 -2729
- data/vendor/depot_tools/third_party/logilab/wrapt/arguments.py +0 -96
- data/vendor/depot_tools/third_party/logilab/wrapt/decorators.py +0 -512
- data/vendor/depot_tools/third_party/logilab/wrapt/importer.py +0 -228
- data/vendor/depot_tools/third_party/logilab/wrapt/wrappers.py +0 -901
- data/vendor/depot_tools/third_party/mock/LICENSE.txt +0 -26
- data/vendor/depot_tools/third_party/mock/README.chromium +0 -24
- data/vendor/depot_tools/third_party/mock/__init__.py +0 -2366
- data/vendor/depot_tools/third_party/oauth2client/LICENSE +0 -202
- data/vendor/depot_tools/third_party/oauth2client/MODIFICATIONS.diff +0 -66
- data/vendor/depot_tools/third_party/oauth2client/README.chromium +0 -15
- data/vendor/depot_tools/third_party/oauth2client/__init__.py +0 -5
- data/vendor/depot_tools/third_party/oauth2client/anyjson.py +0 -32
- data/vendor/depot_tools/third_party/oauth2client/appengine.py +0 -963
- data/vendor/depot_tools/third_party/oauth2client/client.py +0 -1363
- data/vendor/depot_tools/third_party/oauth2client/clientsecrets.py +0 -153
- data/vendor/depot_tools/third_party/oauth2client/crypt.py +0 -377
- data/vendor/depot_tools/third_party/oauth2client/django_orm.py +0 -134
- data/vendor/depot_tools/third_party/oauth2client/file.py +0 -124
- data/vendor/depot_tools/third_party/oauth2client/gce.py +0 -90
- data/vendor/depot_tools/third_party/oauth2client/keyring_storage.py +0 -109
- data/vendor/depot_tools/third_party/oauth2client/locked_file.py +0 -373
- data/vendor/depot_tools/third_party/oauth2client/multistore_file.py +0 -465
- data/vendor/depot_tools/third_party/oauth2client/old_run.py +0 -160
- data/vendor/depot_tools/third_party/oauth2client/tools.py +0 -243
- data/vendor/depot_tools/third_party/oauth2client/util.py +0 -196
- data/vendor/depot_tools/third_party/oauth2client/xsrfutil.py +0 -113
- data/vendor/depot_tools/third_party/protobuf26/README.chromium +0 -23
- data/vendor/depot_tools/third_party/protobuf26/__init__.py +0 -0
- data/vendor/depot_tools/third_party/protobuf26/compiler/__init__.py +0 -0
- data/vendor/depot_tools/third_party/protobuf26/compiler/plugin_pb2.py +0 -184
- data/vendor/depot_tools/third_party/protobuf26/descriptor.py +0 -849
- data/vendor/depot_tools/third_party/protobuf26/descriptor_database.py +0 -137
- data/vendor/depot_tools/third_party/protobuf26/descriptor_pb2.py +0 -1522
- data/vendor/depot_tools/third_party/protobuf26/descriptor_pool.py +0 -643
- data/vendor/depot_tools/third_party/protobuf26/internal/__init__.py +0 -0
- data/vendor/depot_tools/third_party/protobuf26/internal/api_implementation.py +0 -89
- data/vendor/depot_tools/third_party/protobuf26/internal/containers.py +0 -269
- data/vendor/depot_tools/third_party/protobuf26/internal/cpp_message.py +0 -663
- data/vendor/depot_tools/third_party/protobuf26/internal/decoder.py +0 -831
- data/vendor/depot_tools/third_party/protobuf26/internal/encoder.py +0 -788
- data/vendor/depot_tools/third_party/protobuf26/internal/enum_type_wrapper.py +0 -89
- data/vendor/depot_tools/third_party/protobuf26/internal/message_listener.py +0 -78
- data/vendor/depot_tools/third_party/protobuf26/internal/python_message.py +0 -1247
- data/vendor/depot_tools/third_party/protobuf26/internal/type_checkers.py +0 -328
- data/vendor/depot_tools/third_party/protobuf26/internal/wire_format.py +0 -268
- data/vendor/depot_tools/third_party/protobuf26/message.py +0 -284
- data/vendor/depot_tools/third_party/protobuf26/message_factory.py +0 -155
- data/vendor/depot_tools/third_party/protobuf26/reflection.py +0 -205
- data/vendor/depot_tools/third_party/protobuf26/service.py +0 -226
- data/vendor/depot_tools/third_party/protobuf26/service_reflection.py +0 -284
- data/vendor/depot_tools/third_party/protobuf26/symbol_database.py +0 -185
- data/vendor/depot_tools/third_party/protobuf26/text_encoding.py +0 -110
- data/vendor/depot_tools/third_party/protobuf26/text_format.py +0 -873
- data/vendor/depot_tools/third_party/pylint.py +0 -37
- data/vendor/depot_tools/third_party/pylint/LICENSE.txt +0 -340
- data/vendor/depot_tools/third_party/pylint/README.chromium +0 -30
- data/vendor/depot_tools/third_party/pylint/__init__.py +0 -46
- data/vendor/depot_tools/third_party/pylint/__main__.py +0 -3
- data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +0 -80
- data/vendor/depot_tools/third_party/pylint/checkers/__init__.py +0 -123
- data/vendor/depot_tools/third_party/pylint/checkers/async.py +0 -82
- data/vendor/depot_tools/third_party/pylint/checkers/base.py +0 -2010
- data/vendor/depot_tools/third_party/pylint/checkers/classes.py +0 -1120
- data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +0 -348
- data/vendor/depot_tools/third_party/pylint/checkers/exceptions.py +0 -369
- data/vendor/depot_tools/third_party/pylint/checkers/format.py +0 -993
- data/vendor/depot_tools/third_party/pylint/checkers/imports.py +0 -654
- data/vendor/depot_tools/third_party/pylint/checkers/logging.py +0 -258
- data/vendor/depot_tools/third_party/pylint/checkers/misc.py +0 -105
- data/vendor/depot_tools/third_party/pylint/checkers/newstyle.py +0 -169
- data/vendor/depot_tools/third_party/pylint/checkers/python3.py +0 -591
- data/vendor/depot_tools/third_party/pylint/checkers/raw_metrics.py +0 -129
- data/vendor/depot_tools/third_party/pylint/checkers/similar.py +0 -371
- data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +0 -264
- data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +0 -280
- data/vendor/depot_tools/third_party/pylint/checkers/strings.py +0 -618
- data/vendor/depot_tools/third_party/pylint/checkers/typecheck.py +0 -974
- data/vendor/depot_tools/third_party/pylint/checkers/utils.py +0 -741
- data/vendor/depot_tools/third_party/pylint/checkers/variables.py +0 -1191
- data/vendor/depot_tools/third_party/pylint/config.py +0 -820
- data/vendor/depot_tools/third_party/pylint/epylint.py +0 -181
- data/vendor/depot_tools/third_party/pylint/extensions/__init__.py +0 -0
- data/vendor/depot_tools/third_party/pylint/extensions/check_docs.py +0 -311
- data/vendor/depot_tools/third_party/pylint/extensions/check_elif.py +0 -62
- data/vendor/depot_tools/third_party/pylint/graph.py +0 -179
- data/vendor/depot_tools/third_party/pylint/gui.py +0 -531
- data/vendor/depot_tools/third_party/pylint/interfaces.py +0 -102
- data/vendor/depot_tools/third_party/pylint/lint.py +0 -1381
- data/vendor/depot_tools/third_party/pylint/pyreverse/__init__.py +0 -5
- data/vendor/depot_tools/third_party/pylint/pyreverse/diadefslib.py +0 -230
- data/vendor/depot_tools/third_party/pylint/pyreverse/diagrams.py +0 -258
- data/vendor/depot_tools/third_party/pylint/pyreverse/inspector.py +0 -372
- data/vendor/depot_tools/third_party/pylint/pyreverse/main.py +0 -147
- data/vendor/depot_tools/third_party/pylint/pyreverse/utils.py +0 -210
- data/vendor/depot_tools/third_party/pylint/pyreverse/vcgutils.py +0 -198
- data/vendor/depot_tools/third_party/pylint/pyreverse/writer.py +0 -198
- data/vendor/depot_tools/third_party/pylint/reporters/__init__.py +0 -149
- data/vendor/depot_tools/third_party/pylint/reporters/guireporter.py +0 -27
- data/vendor/depot_tools/third_party/pylint/reporters/html.py +0 -108
- data/vendor/depot_tools/third_party/pylint/reporters/json.py +0 -64
- data/vendor/depot_tools/third_party/pylint/reporters/text.py +0 -237
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/__init__.py +0 -106
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/html_writer.py +0 -93
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/nodes.py +0 -181
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/text_writer.py +0 -99
- data/vendor/depot_tools/third_party/pylint/testutils.py +0 -414
- data/vendor/depot_tools/third_party/pylint/utils.py +0 -1148
- data/vendor/depot_tools/third_party/pymox/COPYING +0 -202
- data/vendor/depot_tools/third_party/pymox/MANIFEST.in +0 -5
- data/vendor/depot_tools/third_party/pymox/README +0 -56
- data/vendor/depot_tools/third_party/pymox/__init__.py +0 -0
- data/vendor/depot_tools/third_party/pymox/mox.py +0 -1643
- data/vendor/depot_tools/third_party/pymox/mox_test.py +0 -1708
- data/vendor/depot_tools/third_party/pymox/mox_test_helper.py +0 -76
- data/vendor/depot_tools/third_party/pymox/setup.py +0 -14
- data/vendor/depot_tools/third_party/pymox/stubout.py +0 -142
- data/vendor/depot_tools/third_party/pymox/stubout_test.py +0 -47
- data/vendor/depot_tools/third_party/pymox/stubout_testee.py +0 -2
- data/vendor/depot_tools/third_party/simplejson/LICENSE.txt +0 -19
- data/vendor/depot_tools/third_party/simplejson/PKG-INFO +0 -29
- data/vendor/depot_tools/third_party/simplejson/__init__.py +0 -437
- data/vendor/depot_tools/third_party/simplejson/decoder.py +0 -421
- data/vendor/depot_tools/third_party/simplejson/encoder.py +0 -501
- data/vendor/depot_tools/third_party/simplejson/ordered_dict.py +0 -119
- data/vendor/depot_tools/third_party/simplejson/scanner.py +0 -77
- data/vendor/depot_tools/third_party/simplejson/tool.py +0 -39
- data/vendor/depot_tools/third_party/upload.py +0 -2565
@@ -1,304 +0,0 @@
|
|
1
|
-
Download and docs:
|
2
|
-
http://pypi.python.org/pypi/colorama
|
3
|
-
Development:
|
4
|
-
http://code.google.com/p/colorama
|
5
|
-
Discussion group:
|
6
|
-
https://groups.google.com/forum/#!forum/python-colorama
|
7
|
-
|
8
|
-
Description
|
9
|
-
===========
|
10
|
-
|
11
|
-
Makes ANSI escape character sequences for producing colored terminal text and
|
12
|
-
cursor positioning work under MS Windows.
|
13
|
-
|
14
|
-
ANSI escape character sequences have long been used to produce colored terminal
|
15
|
-
text and cursor positioning on Unix and Macs. Colorama makes this work on
|
16
|
-
Windows, too, by wrapping stdout, stripping ANSI sequences it finds (which
|
17
|
-
otherwise show up as gobbledygook in your output), and converting them into the
|
18
|
-
appropriate win32 calls to modify the state of the terminal. On other platforms,
|
19
|
-
Colorama does nothing.
|
20
|
-
|
21
|
-
Colorama also provides some shortcuts to help generate ANSI sequences
|
22
|
-
but works fine in conjunction with any other ANSI sequence generation library,
|
23
|
-
such as Termcolor (http://pypi.python.org/pypi/termcolor.)
|
24
|
-
|
25
|
-
This has the upshot of providing a simple cross-platform API for printing
|
26
|
-
colored terminal text from Python, and has the happy side-effect that existing
|
27
|
-
applications or libraries which use ANSI sequences to produce colored output on
|
28
|
-
Linux or Macs can now also work on Windows, simply by calling
|
29
|
-
``colorama.init()``.
|
30
|
-
|
31
|
-
An alternative approach is to install 'ansi.sys' on Windows machines, which
|
32
|
-
provides the same behaviour for all applications running in terminals. Colorama
|
33
|
-
is intended for situations where that isn't easy (e.g. maybe your app doesn't
|
34
|
-
have an installer.)
|
35
|
-
|
36
|
-
Demo scripts in the source code repository prints some colored text using
|
37
|
-
ANSI sequences. Compare their output under Gnome-terminal's built in ANSI
|
38
|
-
handling, versus on Windows Command-Prompt using Colorama:
|
39
|
-
|
40
|
-
.. image:: http://colorama.googlecode.com/hg/screenshots/ubuntu-demo.png
|
41
|
-
:width: 661
|
42
|
-
:height: 357
|
43
|
-
:alt: ANSI sequences on Ubuntu under gnome-terminal.
|
44
|
-
|
45
|
-
.. image:: http://colorama.googlecode.com/hg/screenshots/windows-demo.png
|
46
|
-
:width: 668
|
47
|
-
:height: 325
|
48
|
-
:alt: Same ANSI sequences on Windows, using Colorama.
|
49
|
-
|
50
|
-
These screengrabs show that Colorama on Windows does not support ANSI 'dim
|
51
|
-
text': it looks the same as 'normal text'.
|
52
|
-
|
53
|
-
|
54
|
-
License
|
55
|
-
=======
|
56
|
-
|
57
|
-
Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
|
58
|
-
|
59
|
-
|
60
|
-
Dependencies
|
61
|
-
============
|
62
|
-
|
63
|
-
None, other than Python. Tested on Python 2.5.5, 2.6.5, 2.7, 3.1.2, and 3.2
|
64
|
-
|
65
|
-
Usage
|
66
|
-
=====
|
67
|
-
|
68
|
-
Initialisation
|
69
|
-
--------------
|
70
|
-
|
71
|
-
Applications should initialise Colorama using::
|
72
|
-
|
73
|
-
from colorama import init
|
74
|
-
init()
|
75
|
-
|
76
|
-
If you are on Windows, the call to ``init()`` will start filtering ANSI escape
|
77
|
-
sequences out of any text sent to stdout or stderr, and will replace them with
|
78
|
-
equivalent Win32 calls.
|
79
|
-
|
80
|
-
Calling ``init()`` has no effect on other platforms (unless you request other
|
81
|
-
optional functionality, see keyword args below.) The intention is that
|
82
|
-
applications can call ``init()`` unconditionally on all platforms, after which
|
83
|
-
ANSI output should just work.
|
84
|
-
|
85
|
-
To stop using colorama before your program exits, simply call ``deinit()``.
|
86
|
-
This will restore stdout and stderr to their original values, so that Colorama
|
87
|
-
is disabled. To start using Colorama again, call ``reinit()``, which wraps
|
88
|
-
stdout and stderr again, but is cheaper to call than doing ``init()`` all over
|
89
|
-
again.
|
90
|
-
|
91
|
-
|
92
|
-
Colored Output
|
93
|
-
--------------
|
94
|
-
|
95
|
-
Cross-platform printing of colored text can then be done using Colorama's
|
96
|
-
constant shorthand for ANSI escape sequences::
|
97
|
-
|
98
|
-
from colorama import Fore, Back, Style
|
99
|
-
print(Fore.RED + 'some red text')
|
100
|
-
print(Back.GREEN + 'and with a green background')
|
101
|
-
print(Style.DIM + 'and in dim text')
|
102
|
-
print(Fore.RESET + Back.RESET + Style.RESET_ALL)
|
103
|
-
print('back to normal now')
|
104
|
-
|
105
|
-
or simply by manually printing ANSI sequences from your own code::
|
106
|
-
|
107
|
-
print('/033[31m' + 'some red text')
|
108
|
-
print('/033[30m' # and reset to default color)
|
109
|
-
|
110
|
-
or Colorama can be used happily in conjunction with existing ANSI libraries
|
111
|
-
such as Termcolor::
|
112
|
-
|
113
|
-
from colorama import init
|
114
|
-
from termcolor import colored
|
115
|
-
|
116
|
-
# use Colorama to make Termcolor work on Windows too
|
117
|
-
init()
|
118
|
-
|
119
|
-
# then use Termcolor for all colored text output
|
120
|
-
print(colored('Hello, World!', 'green', 'on_red'))
|
121
|
-
|
122
|
-
Available formatting constants are::
|
123
|
-
|
124
|
-
Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
|
125
|
-
Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
|
126
|
-
Style: DIM, NORMAL, BRIGHT, RESET_ALL
|
127
|
-
|
128
|
-
Style.RESET_ALL resets foreground, background and brightness. Colorama will
|
129
|
-
perform this reset automatically on program exit.
|
130
|
-
|
131
|
-
|
132
|
-
Cursor Positioning
|
133
|
-
------------------
|
134
|
-
|
135
|
-
ANSI codes to reposition the cursor are supported. See demos/demo06.py for
|
136
|
-
an example of how to generate them.
|
137
|
-
|
138
|
-
|
139
|
-
Init Keyword Args
|
140
|
-
-----------------
|
141
|
-
|
142
|
-
``init()`` accepts some kwargs to override default behaviour.
|
143
|
-
|
144
|
-
init(autoreset=False):
|
145
|
-
If you find yourself repeatedly sending reset sequences to turn off color
|
146
|
-
changes at the end of every print, then ``init(autoreset=True)`` will
|
147
|
-
automate that::
|
148
|
-
|
149
|
-
from colorama import init
|
150
|
-
init(autoreset=True)
|
151
|
-
print(Fore.RED + 'some red text')
|
152
|
-
print('automatically back to default color again')
|
153
|
-
|
154
|
-
init(strip=None):
|
155
|
-
Pass ``True`` or ``False`` to override whether ansi codes should be
|
156
|
-
stripped from the output. The default behaviour is to strip if on Windows.
|
157
|
-
|
158
|
-
init(convert=None):
|
159
|
-
Pass ``True`` or ``False`` to override whether to convert ansi codes in the
|
160
|
-
output into win32 calls. The default behaviour is to convert if on Windows
|
161
|
-
and output is to a tty (terminal).
|
162
|
-
|
163
|
-
init(wrap=True):
|
164
|
-
On Windows, colorama works by replacing ``sys.stdout`` and ``sys.stderr``
|
165
|
-
with proxy objects, which override the .write() method to do their work. If
|
166
|
-
this wrapping causes you problems, then this can be disabled by passing
|
167
|
-
``init(wrap=False)``. The default behaviour is to wrap if autoreset or
|
168
|
-
strip or convert are True.
|
169
|
-
|
170
|
-
When wrapping is disabled, colored printing on non-Windows platforms will
|
171
|
-
continue to work as normal. To do cross-platform colored output, you can
|
172
|
-
use Colorama's ``AnsiToWin32`` proxy directly::
|
173
|
-
|
174
|
-
import sys
|
175
|
-
from colorama import init, AnsiToWin32
|
176
|
-
init(wrap=False)
|
177
|
-
stream = AnsiToWin32(sys.stderr).stream
|
178
|
-
|
179
|
-
# Python 2
|
180
|
-
print >>stream, Fore.BLUE + 'blue text on stderr'
|
181
|
-
|
182
|
-
# Python 3
|
183
|
-
print(Fore.BLUE + 'blue text on stderr', file=stream)
|
184
|
-
|
185
|
-
|
186
|
-
Status & Known Problems
|
187
|
-
=======================
|
188
|
-
|
189
|
-
I've personally only tested it on WinXP (CMD, Console2), Ubuntu
|
190
|
-
(gnome-terminal, xterm), and OSX.
|
191
|
-
|
192
|
-
Some presumably valid ANSI sequences aren't recognised (see details below)
|
193
|
-
but to my knowledge nobody has yet complained about this. Puzzling.
|
194
|
-
|
195
|
-
See outstanding issues and wishlist at:
|
196
|
-
http://code.google.com/p/colorama/issues/list
|
197
|
-
|
198
|
-
If anything doesn't work for you, or doesn't do what you expected or hoped for,
|
199
|
-
I'd love to hear about it on that issues list, would be delighted by patches,
|
200
|
-
and would be happy to grant commit access to anyone who submits a working patch
|
201
|
-
or two.
|
202
|
-
|
203
|
-
|
204
|
-
Recognised ANSI Sequences
|
205
|
-
=========================
|
206
|
-
|
207
|
-
ANSI sequences generally take the form:
|
208
|
-
|
209
|
-
ESC [ <param> ; <param> ... <command>
|
210
|
-
|
211
|
-
Where <param> is an integer, and <command> is a single letter. Zero or more
|
212
|
-
params are passed to a <command>. If no params are passed, it is generally
|
213
|
-
synonymous with passing a single zero. No spaces exist in the sequence, they
|
214
|
-
have just been inserted here to make it easy to read.
|
215
|
-
|
216
|
-
The only ANSI sequences that colorama converts into win32 calls are::
|
217
|
-
|
218
|
-
ESC [ 0 m # reset all (colors and brightness)
|
219
|
-
ESC [ 1 m # bright
|
220
|
-
ESC [ 2 m # dim (looks same as normal brightness)
|
221
|
-
ESC [ 22 m # normal brightness
|
222
|
-
|
223
|
-
# FOREGROUND:
|
224
|
-
ESC [ 30 m # black
|
225
|
-
ESC [ 31 m # red
|
226
|
-
ESC [ 32 m # green
|
227
|
-
ESC [ 33 m # yellow
|
228
|
-
ESC [ 34 m # blue
|
229
|
-
ESC [ 35 m # magenta
|
230
|
-
ESC [ 36 m # cyan
|
231
|
-
ESC [ 37 m # white
|
232
|
-
ESC [ 39 m # reset
|
233
|
-
|
234
|
-
# BACKGROUND
|
235
|
-
ESC [ 40 m # black
|
236
|
-
ESC [ 41 m # red
|
237
|
-
ESC [ 42 m # green
|
238
|
-
ESC [ 43 m # yellow
|
239
|
-
ESC [ 44 m # blue
|
240
|
-
ESC [ 45 m # magenta
|
241
|
-
ESC [ 46 m # cyan
|
242
|
-
ESC [ 47 m # white
|
243
|
-
ESC [ 49 m # reset
|
244
|
-
|
245
|
-
# cursor positioning
|
246
|
-
ESC [ y;x H # position cursor at x across, y down
|
247
|
-
|
248
|
-
# clear the screen
|
249
|
-
ESC [ mode J # clear the screen. Only mode 2 (clear entire screen)
|
250
|
-
# is supported. It should be easy to add other modes,
|
251
|
-
# let me know if that would be useful.
|
252
|
-
|
253
|
-
Multiple numeric params to the 'm' command can be combined into a single
|
254
|
-
sequence, eg::
|
255
|
-
|
256
|
-
ESC [ 36 ; 45 ; 1 m # bright cyan text on magenta background
|
257
|
-
|
258
|
-
All other ANSI sequences of the form ``ESC [ <param> ; <param> ... <command>``
|
259
|
-
are silently stripped from the output on Windows.
|
260
|
-
|
261
|
-
Any other form of ANSI sequence, such as single-character codes or alternative
|
262
|
-
initial characters, are not recognised nor stripped. It would be cool to add
|
263
|
-
them though. Let me know if it would be useful for you, via the issues on
|
264
|
-
google code.
|
265
|
-
|
266
|
-
|
267
|
-
Development
|
268
|
-
===========
|
269
|
-
|
270
|
-
Help and fixes welcome! Ask Jonathan for commit rights, you'll get them.
|
271
|
-
|
272
|
-
Running tests requires:
|
273
|
-
|
274
|
-
- Michael Foord's 'mock' module to be installed.
|
275
|
-
- Tests are written using the 2010 era updates to 'unittest', and require to
|
276
|
-
be run either using Python2.7 or greater, or else to have Michael Foord's
|
277
|
-
'unittest2' module installed.
|
278
|
-
|
279
|
-
unittest2 test discovery doesn't work for colorama, so I use 'nose'::
|
280
|
-
|
281
|
-
nosetests -s
|
282
|
-
|
283
|
-
The -s is required because 'nosetests' otherwise applies a proxy of its own to
|
284
|
-
stdout, which confuses the unit tests.
|
285
|
-
|
286
|
-
|
287
|
-
Contact
|
288
|
-
=======
|
289
|
-
|
290
|
-
Created by Jonathan Hartley, tartley@tartley.com
|
291
|
-
|
292
|
-
|
293
|
-
Thanks
|
294
|
-
======
|
295
|
-
| Ben Hoyt, for a magnificent fix under 64-bit Windows.
|
296
|
-
| Jesse@EmptySquare for submitting a fix for examples in the README.
|
297
|
-
| User 'jamessp', an observant documentation fix for cursor positioning.
|
298
|
-
| User 'vaal1239', Dave Mckee & Lackner Kristof for a tiny but much-needed Win7 fix.
|
299
|
-
| Julien Stuyck, for wisely suggesting Python3 compatible updates to README.
|
300
|
-
| Daniel Griffith for multiple fabulous patches.
|
301
|
-
| Oscar Lesta for valuable fix to stop ANSI chars being sent to non-tty output.
|
302
|
-
| Roger Binns, for many suggestions, valuable feedback, & bug reports.
|
303
|
-
| Tim Golden for thought and much appreciated feedback on the initial idea.
|
304
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
The fancy_urllib library was obtained from [1] under the following
|
2
|
-
license ([2]):
|
3
|
-
|
4
|
-
GOOGLE APP ENGINE SDK
|
5
|
-
=====================
|
6
|
-
Copyright 2008 Google Inc.
|
7
|
-
All rights reserved.
|
8
|
-
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
you may not use this file except in compliance with the License.
|
11
|
-
You may obtain a copy of the License at
|
12
|
-
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
See the License for the specific language governing permissions and
|
19
|
-
limitations under the License.
|
20
|
-
|
21
|
-
[1] https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/blob/master/python_vm_runtime/lib/fancy_urllib/fancy_urllib/__init__.py
|
22
|
-
[2] https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/blob/master/python_vm_runtime/LICENSE
|
@@ -1,460 +0,0 @@
|
|
1
|
-
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software
|
2
|
-
# Foundation; All Rights Reserved
|
3
|
-
|
4
|
-
"""A HTTPSConnection/Handler with additional proxy and cert validation features.
|
5
|
-
|
6
|
-
In particular, monkey patches in Python r74203 to provide support for CONNECT
|
7
|
-
proxies and adds SSL cert validation if the ssl module is present.
|
8
|
-
"""
|
9
|
-
|
10
|
-
__author__ = "{frew,nick.johnson}@google.com (Fred Wulff and Nick Johnson)"
|
11
|
-
|
12
|
-
import base64
|
13
|
-
import httplib
|
14
|
-
import logging
|
15
|
-
import socket
|
16
|
-
from urllib import splitpasswd
|
17
|
-
from urllib import splittype
|
18
|
-
from urllib import splituser
|
19
|
-
import urllib2
|
20
|
-
|
21
|
-
|
22
|
-
class InvalidCertificateException(httplib.HTTPException):
|
23
|
-
"""Raised when a certificate is provided with an invalid hostname."""
|
24
|
-
|
25
|
-
def __init__(self, host, cert, reason):
|
26
|
-
"""Constructor.
|
27
|
-
|
28
|
-
Args:
|
29
|
-
host: The hostname the connection was made to.
|
30
|
-
cert: The SSL certificate (as a dictionary) the host returned.
|
31
|
-
reason: user readable error reason.
|
32
|
-
"""
|
33
|
-
httplib.HTTPException.__init__(self)
|
34
|
-
self.host = host
|
35
|
-
self.cert = cert
|
36
|
-
self.reason = reason
|
37
|
-
|
38
|
-
def __str__(self):
|
39
|
-
return ("Host %s returned an invalid certificate (%s): %s\n"
|
40
|
-
"To learn more, see "
|
41
|
-
"http://code.google.com/appengine/kb/general.html#rpcssl" %
|
42
|
-
(self.host, self.reason, self.cert))
|
43
|
-
|
44
|
-
|
45
|
-
try:
|
46
|
-
import ssl
|
47
|
-
_CAN_VALIDATE_CERTS = True
|
48
|
-
except ImportError:
|
49
|
-
_CAN_VALIDATE_CERTS = False
|
50
|
-
|
51
|
-
|
52
|
-
def can_validate_certs():
|
53
|
-
"""Return True if we have the SSL package and can validate certificates."""
|
54
|
-
return _CAN_VALIDATE_CERTS
|
55
|
-
|
56
|
-
|
57
|
-
# Reexport SSLError so clients don't have to to do their own checking for ssl's
|
58
|
-
# existence.
|
59
|
-
if can_validate_certs():
|
60
|
-
SSLError = ssl.SSLError
|
61
|
-
else:
|
62
|
-
SSLError = None
|
63
|
-
|
64
|
-
|
65
|
-
def create_fancy_connection(tunnel_host=None, key_file=None,
|
66
|
-
cert_file=None, ca_certs=None,
|
67
|
-
proxy_authorization=None):
|
68
|
-
# This abomination brought to you by the fact that
|
69
|
-
# the HTTPHandler creates the connection instance in the middle
|
70
|
-
# of do_open so we need to add the tunnel host to the class.
|
71
|
-
|
72
|
-
class PresetProxyHTTPSConnection(httplib.HTTPSConnection):
|
73
|
-
"""An HTTPS connection that uses a proxy defined by the enclosing scope."""
|
74
|
-
|
75
|
-
def __init__(self, *args, **kwargs):
|
76
|
-
httplib.HTTPSConnection.__init__(self, *args, **kwargs)
|
77
|
-
|
78
|
-
self._tunnel_host = tunnel_host
|
79
|
-
if tunnel_host:
|
80
|
-
logging.debug("Creating preset proxy https conn: %s", tunnel_host)
|
81
|
-
|
82
|
-
self.key_file = key_file
|
83
|
-
self.cert_file = cert_file
|
84
|
-
self.ca_certs = ca_certs
|
85
|
-
if can_validate_certs():
|
86
|
-
if self.ca_certs:
|
87
|
-
self.cert_reqs = ssl.CERT_REQUIRED
|
88
|
-
else:
|
89
|
-
self.cert_reqs = ssl.CERT_NONE
|
90
|
-
|
91
|
-
def _get_hostport(self, host, port):
|
92
|
-
# Python 2.7.7rc1 (hg r90728:568041fd8090), 3.4.1 and 3.5 rename
|
93
|
-
# _set_hostport to _get_hostport and changes it's functionality. The
|
94
|
-
# Python 2.7.7rc1 version of this method is included here for
|
95
|
-
# compatibility with earlier versions of Python. Without this, HTTPS over
|
96
|
-
# HTTP CONNECT proxies cannot be used.
|
97
|
-
|
98
|
-
# This method may be removed if compatibility with Python <2.7.7rc1 is not
|
99
|
-
# required.
|
100
|
-
|
101
|
-
# Python bug: http://bugs.python.org/issue7776
|
102
|
-
if port is None:
|
103
|
-
i = host.rfind(":")
|
104
|
-
j = host.rfind("]") # ipv6 addresses have [...]
|
105
|
-
if i > j:
|
106
|
-
try:
|
107
|
-
port = int(host[i+1:])
|
108
|
-
except ValueError:
|
109
|
-
if host[i+1:] == "": # http://foo.com:/ == http://foo.com/
|
110
|
-
port = self.default_port
|
111
|
-
else:
|
112
|
-
raise httplib.InvalidURL("nonnumeric port: '%s'" % host[i+1:])
|
113
|
-
host = host[:i]
|
114
|
-
else:
|
115
|
-
port = self.default_port
|
116
|
-
if host and host[0] == "[" and host[-1] == "]":
|
117
|
-
host = host[1:-1]
|
118
|
-
|
119
|
-
return (host, port)
|
120
|
-
|
121
|
-
def _tunnel(self):
|
122
|
-
self.host, self.port = self._get_hostport(self._tunnel_host, None)
|
123
|
-
logging.info("Connecting through tunnel to: %s:%d",
|
124
|
-
self.host, self.port)
|
125
|
-
|
126
|
-
self.send("CONNECT %s:%d HTTP/1.0\r\n" % (self.host, self.port))
|
127
|
-
|
128
|
-
if proxy_authorization:
|
129
|
-
self.send("Proxy-Authorization: %s\r\n" % proxy_authorization)
|
130
|
-
|
131
|
-
# blank line
|
132
|
-
self.send("\r\n")
|
133
|
-
|
134
|
-
response = self.response_class(self.sock, strict=self.strict,
|
135
|
-
method=self._method)
|
136
|
-
# pylint: disable=protected-access
|
137
|
-
(_, code, message) = response._read_status()
|
138
|
-
|
139
|
-
if code != 200:
|
140
|
-
self.close()
|
141
|
-
raise socket.error("Tunnel connection failed: %d %s" %
|
142
|
-
(code, message.strip()))
|
143
|
-
|
144
|
-
while True:
|
145
|
-
line = response.fp.readline()
|
146
|
-
if line == "\r\n":
|
147
|
-
break
|
148
|
-
|
149
|
-
def _get_valid_hosts_for_cert(self, cert):
|
150
|
-
"""Returns a list of valid host globs for an SSL certificate.
|
151
|
-
|
152
|
-
Args:
|
153
|
-
cert: A dictionary representing an SSL certificate.
|
154
|
-
Returns:
|
155
|
-
list: A list of valid host globs.
|
156
|
-
"""
|
157
|
-
if "subjectAltName" in cert:
|
158
|
-
return [x[1] for x in cert["subjectAltName"] if x[0].lower() == "dns"]
|
159
|
-
else:
|
160
|
-
# Return a list of commonName fields
|
161
|
-
return [x[0][1] for x in cert["subject"]
|
162
|
-
if x[0][0].lower() == "commonname"]
|
163
|
-
|
164
|
-
def _validate_certificate_hostname(self, cert, hostname):
|
165
|
-
"""Perform RFC2818/6125 validation against a cert and hostname.
|
166
|
-
|
167
|
-
Args:
|
168
|
-
cert: A dictionary representing an SSL certificate.
|
169
|
-
hostname: The hostname to test.
|
170
|
-
Returns:
|
171
|
-
bool: Whether or not the hostname is valid for this certificate.
|
172
|
-
"""
|
173
|
-
hosts = self._get_valid_hosts_for_cert(cert)
|
174
|
-
for host in hosts:
|
175
|
-
# Wildcards are only valid when the * exists at the end of the last
|
176
|
-
# (left-most) label, and there are at least 3 labels in the expression.
|
177
|
-
if ("*." in host and host.count("*") == 1 and
|
178
|
-
host.count(".") > 1 and "." in hostname):
|
179
|
-
left_expected, right_expected = host.split("*.")
|
180
|
-
left_hostname, right_hostname = hostname.split(".", 1)
|
181
|
-
if (left_hostname.startswith(left_expected) and
|
182
|
-
right_expected == right_hostname):
|
183
|
-
return True
|
184
|
-
elif host == hostname:
|
185
|
-
return True
|
186
|
-
return False
|
187
|
-
|
188
|
-
def connect(self):
|
189
|
-
# TODO(frew): When we drop support for <2.6 (in the far distant future),
|
190
|
-
# change this to socket.create_connection.
|
191
|
-
self.sock = _create_connection((self.host, self.port))
|
192
|
-
|
193
|
-
if self._tunnel_host:
|
194
|
-
self._tunnel()
|
195
|
-
|
196
|
-
# ssl and FakeSocket got deprecated. Try for the new hotness of wrap_ssl,
|
197
|
-
# with fallback. Note: Since can_validate_certs() just checks for the
|
198
|
-
# ssl module, it's equivalent to attempting to import ssl from
|
199
|
-
# the function, but doesn't require a dynamic import, which doesn't
|
200
|
-
# play nicely with dev_appserver.
|
201
|
-
if can_validate_certs():
|
202
|
-
self.sock = ssl.wrap_socket(self.sock,
|
203
|
-
keyfile=self.key_file,
|
204
|
-
certfile=self.cert_file,
|
205
|
-
ca_certs=self.ca_certs,
|
206
|
-
cert_reqs=self.cert_reqs)
|
207
|
-
|
208
|
-
if self.cert_reqs & ssl.CERT_REQUIRED:
|
209
|
-
cert = self.sock.getpeercert()
|
210
|
-
hostname = self.host.split(":", 0)[0]
|
211
|
-
if not self._validate_certificate_hostname(cert, hostname):
|
212
|
-
raise InvalidCertificateException(hostname, cert,
|
213
|
-
"hostname mismatch")
|
214
|
-
else:
|
215
|
-
ssl_socket = socket.ssl(self.sock,
|
216
|
-
keyfile=self.key_file,
|
217
|
-
certfile=self.cert_file)
|
218
|
-
self.sock = httplib.FakeSocket(self.sock, ssl_socket)
|
219
|
-
|
220
|
-
return PresetProxyHTTPSConnection
|
221
|
-
|
222
|
-
|
223
|
-
# Here to end of _create_connection copied wholesale from Python 2.6"s socket.py
|
224
|
-
_GLOBAL_DEFAULT_TIMEOUT = object()
|
225
|
-
|
226
|
-
|
227
|
-
def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
|
228
|
-
"""Connect to *address* and return the socket object.
|
229
|
-
|
230
|
-
Convenience function. Connect to *address* (a 2-tuple ``(host,
|
231
|
-
port)``) and return the socket object. Passing the optional
|
232
|
-
*timeout* parameter will set the timeout on the socket instance
|
233
|
-
before attempting to connect. If no *timeout* is supplied, the
|
234
|
-
global default timeout setting returned by :func:`getdefaulttimeout`
|
235
|
-
is used.
|
236
|
-
"""
|
237
|
-
|
238
|
-
msg = "getaddrinfo returns an empty list"
|
239
|
-
host, port = address
|
240
|
-
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
|
241
|
-
af, socktype, proto, canonname, sa = res
|
242
|
-
sock = None
|
243
|
-
try:
|
244
|
-
sock = socket.socket(af, socktype, proto)
|
245
|
-
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
|
246
|
-
sock.settimeout(timeout)
|
247
|
-
sock.connect(sa)
|
248
|
-
return sock
|
249
|
-
|
250
|
-
except socket.error, msg:
|
251
|
-
if sock is not None:
|
252
|
-
sock.close()
|
253
|
-
|
254
|
-
raise socket.error, msg
|
255
|
-
|
256
|
-
|
257
|
-
class FancyRequest(urllib2.Request):
|
258
|
-
"""A request that allows the use of a CONNECT proxy."""
|
259
|
-
|
260
|
-
def __init__(self, *args, **kwargs):
|
261
|
-
urllib2.Request.__init__(self, *args, **kwargs)
|
262
|
-
self._tunnel_host = None
|
263
|
-
self._key_file = None
|
264
|
-
self._cert_file = None
|
265
|
-
self._ca_certs = None
|
266
|
-
|
267
|
-
def set_proxy(self, host, type):
|
268
|
-
saved_type = None
|
269
|
-
|
270
|
-
if self.get_type() == "https" and not self._tunnel_host:
|
271
|
-
self._tunnel_host = self.get_host()
|
272
|
-
saved_type = self.get_type()
|
273
|
-
urllib2.Request.set_proxy(self, host, type)
|
274
|
-
|
275
|
-
if saved_type:
|
276
|
-
# Don't set self.type, we want to preserve the
|
277
|
-
# type for tunneling.
|
278
|
-
self.type = saved_type
|
279
|
-
|
280
|
-
def set_ssl_info(self, key_file=None, cert_file=None, ca_certs=None):
|
281
|
-
self._key_file = key_file
|
282
|
-
self._cert_file = cert_file
|
283
|
-
self._ca_certs = ca_certs
|
284
|
-
|
285
|
-
|
286
|
-
class FancyProxyHandler(urllib2.ProxyHandler):
|
287
|
-
"""A ProxyHandler that works with CONNECT-enabled proxies."""
|
288
|
-
|
289
|
-
# Taken verbatim from /usr/lib/python2.5/urllib2.py
|
290
|
-
def _parse_proxy(self, proxy):
|
291
|
-
"""Return (scheme, user, password, host/port) given a URL or an authority.
|
292
|
-
|
293
|
-
If a URL is supplied, it must have an authority (host:port) component.
|
294
|
-
According to RFC 3986, having an authority component means the URL must
|
295
|
-
have two slashes after the scheme:
|
296
|
-
|
297
|
-
>>> _parse_proxy('file:/ftp.example.com/')
|
298
|
-
Traceback (most recent call last):
|
299
|
-
ValueError: proxy URL with no authority: 'file:/ftp.example.com/'
|
300
|
-
|
301
|
-
The first three items of the returned tuple may be None.
|
302
|
-
|
303
|
-
Examples of authority parsing:
|
304
|
-
|
305
|
-
>>> _parse_proxy('proxy.example.com')
|
306
|
-
(None, None, None, 'proxy.example.com')
|
307
|
-
>>> _parse_proxy('proxy.example.com:3128')
|
308
|
-
(None, None, None, 'proxy.example.com:3128')
|
309
|
-
|
310
|
-
The authority component may optionally include userinfo (assumed to be
|
311
|
-
username:password):
|
312
|
-
|
313
|
-
>>> _parse_proxy('joe:password@proxy.example.com')
|
314
|
-
(None, 'joe', 'password', 'proxy.example.com')
|
315
|
-
>>> _parse_proxy('joe:password@proxy.example.com:3128')
|
316
|
-
(None, 'joe', 'password', 'proxy.example.com:3128')
|
317
|
-
|
318
|
-
Same examples, but with URLs instead:
|
319
|
-
|
320
|
-
>>> _parse_proxy('http://proxy.example.com/')
|
321
|
-
('http', None, None, 'proxy.example.com')
|
322
|
-
>>> _parse_proxy('http://proxy.example.com:3128/')
|
323
|
-
('http', None, None, 'proxy.example.com:3128')
|
324
|
-
>>> _parse_proxy('http://joe:password@proxy.example.com/')
|
325
|
-
('http', 'joe', 'password', 'proxy.example.com')
|
326
|
-
>>> _parse_proxy('http://joe:password@proxy.example.com:3128')
|
327
|
-
('http', 'joe', 'password', 'proxy.example.com:3128')
|
328
|
-
|
329
|
-
Everything after the authority is ignored:
|
330
|
-
|
331
|
-
>>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128')
|
332
|
-
('ftp', 'joe', 'password', 'proxy.example.com')
|
333
|
-
|
334
|
-
Test for no trailing '/' case:
|
335
|
-
|
336
|
-
>>> _parse_proxy('http://joe:password@proxy.example.com')
|
337
|
-
('http', 'joe', 'password', 'proxy.example.com')
|
338
|
-
|
339
|
-
"""
|
340
|
-
scheme, r_scheme = splittype(proxy)
|
341
|
-
if not r_scheme.startswith("/"):
|
342
|
-
# authority
|
343
|
-
scheme = None
|
344
|
-
authority = proxy
|
345
|
-
else:
|
346
|
-
# URL
|
347
|
-
if not r_scheme.startswith("//"):
|
348
|
-
raise ValueError("proxy URL with no authority: %r" % proxy)
|
349
|
-
# We have an authority, so for RFC 3986-compliant URLs (by ss 3.
|
350
|
-
# and 3.3.), path is empty or starts with '/'
|
351
|
-
end = r_scheme.find("/", 2)
|
352
|
-
if end == -1:
|
353
|
-
end = None
|
354
|
-
authority = r_scheme[2:end]
|
355
|
-
userinfo, hostport = splituser(authority)
|
356
|
-
if userinfo is not None:
|
357
|
-
user, password = splitpasswd(userinfo)
|
358
|
-
else:
|
359
|
-
user = password = None
|
360
|
-
return scheme, user, password, hostport
|
361
|
-
|
362
|
-
def proxy_open(self, req, proxy, type):
|
363
|
-
# This block is copied wholesale from Python2.6 urllib2.
|
364
|
-
# It is idempotent, so the superclass method call executes as normal
|
365
|
-
# if invoked.
|
366
|
-
orig_type = req.get_type()
|
367
|
-
proxy_type, user, password, hostport = self._parse_proxy(proxy)
|
368
|
-
if proxy_type is None:
|
369
|
-
proxy_type = orig_type
|
370
|
-
if user and password:
|
371
|
-
user_pass = "%s:%s" % (urllib2.unquote(user), urllib2.unquote(password))
|
372
|
-
creds = base64.b64encode(user_pass).strip()
|
373
|
-
# Later calls overwrite earlier calls for the same header
|
374
|
-
req.add_header("Proxy-authorization", "Basic " + creds)
|
375
|
-
hostport = urllib2.unquote(hostport)
|
376
|
-
req.set_proxy(hostport, proxy_type)
|
377
|
-
# This condition is the change
|
378
|
-
if orig_type == "https":
|
379
|
-
return None
|
380
|
-
|
381
|
-
return urllib2.ProxyHandler.proxy_open(self, req, proxy, type)
|
382
|
-
|
383
|
-
|
384
|
-
class FancyHTTPSHandler(urllib2.HTTPSHandler):
|
385
|
-
"""An HTTPSHandler that works with CONNECT-enabled proxies."""
|
386
|
-
|
387
|
-
def do_open(self, http_class, req, *args, **kwargs):
|
388
|
-
proxy_authorization = None
|
389
|
-
for header in req.headers:
|
390
|
-
if header.lower() == "proxy-authorization":
|
391
|
-
proxy_authorization = req.headers[header]
|
392
|
-
break
|
393
|
-
|
394
|
-
# Intentionally very specific so as to opt for false negatives
|
395
|
-
# rather than false positives.
|
396
|
-
try:
|
397
|
-
return urllib2.HTTPSHandler.do_open(
|
398
|
-
self,
|
399
|
-
create_fancy_connection(req._tunnel_host,
|
400
|
-
req._key_file,
|
401
|
-
req._cert_file,
|
402
|
-
req._ca_certs,
|
403
|
-
proxy_authorization),
|
404
|
-
req, *args, **kwargs)
|
405
|
-
except urllib2.URLError, url_error:
|
406
|
-
try:
|
407
|
-
import ssl
|
408
|
-
if (type(url_error.reason) == ssl.SSLError and
|
409
|
-
url_error.reason.args[0] == 1):
|
410
|
-
# Display the reason to the user. Need to use args for python2.5
|
411
|
-
# compat.
|
412
|
-
raise InvalidCertificateException(req.host, "",
|
413
|
-
url_error.reason.args[1])
|
414
|
-
except ImportError:
|
415
|
-
pass
|
416
|
-
|
417
|
-
raise url_error
|
418
|
-
|
419
|
-
|
420
|
-
# We have to implement this so that we persist the tunneling behavior
|
421
|
-
# through redirects.
|
422
|
-
class FancyRedirectHandler(urllib2.HTTPRedirectHandler):
|
423
|
-
"""A redirect handler that persists CONNECT-enabled proxy information."""
|
424
|
-
|
425
|
-
def redirect_request(self, req, *args, **kwargs):
|
426
|
-
new_req = urllib2.HTTPRedirectHandler.redirect_request(
|
427
|
-
self, req, *args, **kwargs)
|
428
|
-
# Same thing as in our set_proxy implementation, but in this case
|
429
|
-
# we"ve only got a Request to work with, so it was this or copy
|
430
|
-
# everything over piecemeal.
|
431
|
-
#
|
432
|
-
# Note that we do not persist tunneling behavior from an http request
|
433
|
-
# to an https request, because an http request does not set _tunnel_host.
|
434
|
-
#
|
435
|
-
# Also note that in Python < 2.6, you will get an error in
|
436
|
-
# FancyHTTPSHandler.do_open() on an https urllib2.Request that uses an http
|
437
|
-
# proxy, since the proxy type will be set to http instead of https.
|
438
|
-
# (FancyRequest, and urllib2.Request in Python >= 2.6 set the proxy type to
|
439
|
-
# https.) Such an urllib2.Request could result from this redirect
|
440
|
-
# if you are redirecting from an http request (since an an http request
|
441
|
-
# does not have _tunnel_host set, and thus you will not set the proxy
|
442
|
-
# in the code below), and if you have defined a proxy for https in, say,
|
443
|
-
# FancyProxyHandler, and that proxy has type http.
|
444
|
-
if hasattr(req, "_tunnel_host") and isinstance(new_req, urllib2.Request):
|
445
|
-
if new_req.get_type() == "https":
|
446
|
-
if req._tunnel_host:
|
447
|
-
# req is proxied, so copy the proxy info.
|
448
|
-
new_req._tunnel_host = new_req.get_host()
|
449
|
-
new_req.set_proxy(req.host, "https")
|
450
|
-
else:
|
451
|
-
# req is not proxied, so just make sure _tunnel_host is defined.
|
452
|
-
new_req._tunnel_host = None
|
453
|
-
new_req.type = "https"
|
454
|
-
if hasattr(req, "_key_file") and isinstance(new_req, urllib2.Request):
|
455
|
-
# Copy the auxiliary data in case this or any further redirect is https
|
456
|
-
new_req._key_file = req._key_file
|
457
|
-
new_req._cert_file = req._cert_file
|
458
|
-
new_req._ca_certs = req._ca_certs
|
459
|
-
|
460
|
-
return new_req
|