libv8 6.7.288.46.1 → 7.3.492.27.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 +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/ext/libv8/builder.rb +6 -2
- data/lib/libv8/version.rb +1 -1
- data/vendor/depot_tools/.gitattributes +1 -0
- data/vendor/depot_tools/.gitignore +7 -0
- data/vendor/depot_tools/CROS_OWNERS +5 -0
- data/vendor/depot_tools/OWNERS +12 -1
- data/vendor/depot_tools/PRESUBMIT.py +16 -9
- data/vendor/depot_tools/README.md +9 -2
- data/vendor/depot_tools/autoninja +14 -6
- data/vendor/depot_tools/autoninja.bat +11 -1
- data/vendor/depot_tools/autoninja.py +40 -18
- data/vendor/depot_tools/bb +12 -0
- data/vendor/depot_tools/bb.bat +7 -0
- data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/win_tools.py +2 -1
- data/vendor/depot_tools/buildbucket.py +57 -4
- data/vendor/depot_tools/cipd +157 -44
- data/vendor/depot_tools/cipd.bat +51 -14
- data/vendor/depot_tools/cipd.ps1 +104 -42
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_client_version.digests +21 -0
- data/vendor/depot_tools/cipd_manifest.txt +19 -6
- data/vendor/depot_tools/cipd_manifest.versions +318 -0
- data/vendor/depot_tools/clang_format.py +4 -4
- data/vendor/depot_tools/cpplint.py +44 -199
- data/vendor/depot_tools/dart_format.py +2 -2
- data/vendor/depot_tools/detect_host_arch.py +8 -3
- data/vendor/depot_tools/download_from_google_storage.py +47 -39
- data/vendor/depot_tools/fetch.py +30 -18
- data/vendor/depot_tools/fetch_configs/android_internal.py +34 -0
- data/vendor/depot_tools/fetch_configs/chromium.py +18 -1
- data/vendor/depot_tools/fetch_configs/config_util.py +4 -2
- data/vendor/depot_tools/fetch_configs/inspector_protocol.py +40 -0
- data/vendor/depot_tools/fetch_configs/node-ci.py +41 -0
- data/vendor/depot_tools/fix_encoding.py +3 -3
- data/vendor/depot_tools/gclient +1 -1
- data/vendor/depot_tools/gclient.py +415 -198
- data/vendor/depot_tools/gclient_eval.py +220 -171
- data/vendor/depot_tools/gclient_paths.py +142 -0
- data/vendor/depot_tools/gclient_scm.py +200 -51
- data/vendor/depot_tools/gclient_utils.py +88 -191
- data/vendor/depot_tools/gerrit_client.py +13 -0
- data/vendor/depot_tools/gerrit_util.py +158 -23
- data/vendor/depot_tools/git-nav-upstream +1 -1
- data/vendor/depot_tools/git_cache.py +77 -24
- data/vendor/depot_tools/git_cl.py +705 -1099
- data/vendor/depot_tools/git_common.py +9 -6
- data/vendor/depot_tools/git_map_branches.py +19 -2
- data/vendor/depot_tools/git_nav_downstream.py +3 -4
- data/vendor/depot_tools/git_rebase_update.py +14 -0
- data/vendor/depot_tools/git_reparent_branch.py +8 -2
- data/vendor/depot_tools/gn.py +38 -3
- data/vendor/depot_tools/gsutil.py +8 -3
- data/vendor/depot_tools/gsutil.py.bat +15 -0
- data/vendor/depot_tools/gsutil.vpython +16 -0
- data/vendor/depot_tools/infra/config/OWNERS +0 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +3 -2
- data/vendor/depot_tools/lucicfg +12 -0
- data/vendor/depot_tools/lucicfg.bat +7 -0
- data/vendor/depot_tools/man/html/git-map-branches.html +34 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +40 -32
- data/vendor/depot_tools/man/man1/git-map-branches.1 +24 -5
- data/vendor/depot_tools/man/man1/git-new-branch.1 +35 -27
- data/vendor/depot_tools/man/src/git-map-branches.demo.1.sh +1 -0
- data/vendor/depot_tools/man/src/git-map-branches.txt +10 -0
- data/vendor/depot_tools/man/src/git-new-branch.demo.1.sh +9 -4
- data/vendor/depot_tools/man/src/git-new-branch.txt +1 -1
- data/vendor/depot_tools/metrics.README.md +98 -0
- data/vendor/depot_tools/metrics.py +296 -0
- data/vendor/depot_tools/metrics_utils.py +303 -0
- data/vendor/depot_tools/my_activity.py +91 -29
- data/vendor/depot_tools/ninja +1 -1
- data/vendor/depot_tools/ninjalog.README.md +64 -0
- data/vendor/depot_tools/ninjalog_uploader.py +232 -0
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +116 -0
- data/vendor/depot_tools/owners.py +30 -13
- data/vendor/depot_tools/owners_finder.py +5 -2
- data/vendor/depot_tools/presubmit_canned_checks.py +188 -29
- data/vendor/depot_tools/presubmit_support.py +18 -41
- data/vendor/depot_tools/pylintrc +23 -19
- data/vendor/depot_tools/recipes/OWNERS +2 -0
- data/vendor/depot_tools/recipes/README.recipes.md +344 -151
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +2 -16
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +141 -99
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +5 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +5 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +6 -98
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +45 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob.json → input_commit_with_id_without_repo.json} +6 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob_empty_revision.json → multiple_patch_refs.json} +8 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +19 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange.json → refs.json} +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +51 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +50 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +51 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +18 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +18 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +26 -28
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +45 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +13 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +13 -152
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +185 -202
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +52 -157
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +5 -14
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +34 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +14 -2
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +7 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +13 -8
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.py +3 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +58 -46
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +65 -22
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +5 -2
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +62 -14
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +24 -38
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +56 -50
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +15 -9
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +4 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +34 -22
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +224 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +10 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +5 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +5 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +10 -5
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +8 -9
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +12 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +27 -11
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +12 -13
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +120 -5
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +45 -3
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +56 -4
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +6 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +24 -13
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +13 -14
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/basic.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +1 -2
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +35 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +116 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +23 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +2 -7
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +7 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +117 -8
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +7 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +98 -7
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +147 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +8 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +8 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +9 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +9 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +27 -2
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/test_api.py +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/__init__.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/api.py +137 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +107 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +26 -0
- data/vendor/depot_tools/recipes/recipes.py +37 -27
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +7 -10
- data/vendor/depot_tools/repo +34 -8
- data/vendor/depot_tools/roll_dep.py +52 -49
- data/vendor/depot_tools/scm.py +38 -23
- data/vendor/depot_tools/setup_color.py +4 -2
- data/vendor/depot_tools/split_cl.py +32 -4
- data/vendor/depot_tools/subprocess2.py +22 -4
- data/vendor/depot_tools/third_party/httplib2/README.chromium +2 -2
- data/vendor/depot_tools/third_party/httplib2/__init__.py +242 -158
- data/vendor/depot_tools/third_party/httplib2/cacerts.txt +57 -44
- data/vendor/depot_tools/third_party/httplib2/socks.py +15 -5
- data/vendor/depot_tools/third_party/logilab/README.chromium +2 -4
- data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +2 -1
- data/vendor/depot_tools/third_party/logilab/astroid/__init__.py +10 -5
- data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +5 -5
- data/vendor/depot_tools/third_party/logilab/astroid/arguments.py +233 -0
- data/vendor/depot_tools/third_party/logilab/astroid/as_string.py +82 -33
- data/vendor/depot_tools/third_party/logilab/astroid/bases.py +137 -153
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{builtin_inference.py → brain_builtin_inference.py} +117 -26
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_dateutil.py +15 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2gi.py → brain_gi.py} +48 -8
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2mechanize.py → brain_mechanize.py} +0 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{pynose.py → brain_nose.py} +4 -1
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_numpy.py +62 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_pytest.py +76 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_qt.py +44 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{pysix_moves.py → brain_six.py} +28 -1
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_ssl.py +65 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_stdlib.py +473 -0
- data/vendor/depot_tools/third_party/logilab/astroid/builder.py +104 -81
- data/vendor/depot_tools/third_party/logilab/astroid/context.py +81 -0
- data/vendor/depot_tools/third_party/logilab/astroid/decorators.py +75 -0
- data/vendor/depot_tools/third_party/logilab/astroid/exceptions.py +20 -0
- data/vendor/depot_tools/third_party/logilab/astroid/inference.py +137 -183
- data/vendor/depot_tools/third_party/logilab/astroid/manager.py +45 -169
- data/vendor/depot_tools/third_party/logilab/astroid/mixins.py +37 -14
- data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +112 -41
- data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +243 -156
- data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +35 -22
- data/vendor/depot_tools/third_party/logilab/astroid/objects.py +186 -0
- data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +157 -102
- data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +32 -8
- data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +372 -309
- data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +652 -420
- data/vendor/depot_tools/third_party/logilab/astroid/test_utils.py +4 -21
- data/vendor/depot_tools/third_party/logilab/astroid/transforms.py +96 -0
- data/vendor/depot_tools/third_party/logilab/astroid/util.py +89 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/LICENSE +19 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/README.chromium +11 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/__init__.py +20 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/cext.c +1421 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/compat.py +9 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/simple.py +246 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/slots.py +414 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/utils.py +13 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/LICENSE +24 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/README.chromium +11 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/__init__.py +19 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/_wrappers.c +2729 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/arguments.py +96 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/decorators.py +512 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/importer.py +228 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/wrappers.py +901 -0
- data/vendor/depot_tools/third_party/pylint/README.chromium +2 -25
- data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +13 -3
- data/vendor/depot_tools/third_party/pylint/checkers/__init__.py +1 -2
- data/vendor/depot_tools/third_party/pylint/checkers/async.py +82 -0
- data/vendor/depot_tools/third_party/pylint/checkers/base.py +893 -119
- data/vendor/depot_tools/third_party/pylint/checkers/classes.py +342 -204
- data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +51 -34
- data/vendor/depot_tools/third_party/pylint/checkers/exceptions.py +84 -47
- data/vendor/depot_tools/third_party/pylint/checkers/format.py +55 -30
- data/vendor/depot_tools/third_party/pylint/checkers/imports.py +314 -73
- data/vendor/depot_tools/third_party/pylint/checkers/logging.py +10 -8
- data/vendor/depot_tools/third_party/pylint/checkers/misc.py +2 -1
- data/vendor/depot_tools/third_party/pylint/checkers/newstyle.py +45 -48
- data/vendor/depot_tools/third_party/pylint/checkers/python3.py +31 -21
- data/vendor/depot_tools/third_party/pylint/checkers/raw_metrics.py +3 -3
- data/vendor/depot_tools/third_party/pylint/checkers/similar.py +4 -5
- data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +24 -10
- data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +120 -56
- data/vendor/depot_tools/third_party/pylint/checkers/strings.py +38 -35
- data/vendor/depot_tools/third_party/pylint/checkers/typecheck.py +485 -138
- data/vendor/depot_tools/third_party/pylint/checkers/utils.py +319 -142
- data/vendor/depot_tools/third_party/pylint/checkers/variables.py +329 -207
- data/vendor/depot_tools/third_party/pylint/config.py +739 -76
- data/vendor/depot_tools/third_party/pylint/epylint.py +9 -5
- data/vendor/depot_tools/third_party/pylint/extensions/__init__.py +0 -0
- data/vendor/depot_tools/third_party/pylint/extensions/check_docs.py +311 -0
- data/vendor/depot_tools/third_party/pylint/extensions/check_elif.py +62 -0
- data/vendor/depot_tools/third_party/{logilab/common → pylint}/graph.py +30 -133
- data/vendor/depot_tools/third_party/pylint/gui.py +2 -2
- data/vendor/depot_tools/third_party/pylint/interfaces.py +21 -3
- data/vendor/depot_tools/third_party/pylint/lint.py +123 -140
- data/vendor/depot_tools/third_party/pylint/pyreverse/diadefslib.py +10 -13
- data/vendor/depot_tools/third_party/pylint/pyreverse/diagrams.py +15 -4
- data/vendor/depot_tools/third_party/pylint/pyreverse/inspector.py +372 -0
- data/vendor/depot_tools/third_party/pylint/pyreverse/main.py +30 -7
- data/vendor/depot_tools/third_party/pylint/pyreverse/utils.py +80 -2
- data/vendor/depot_tools/third_party/{logilab/common → pylint/pyreverse}/vcgutils.py +19 -37
- data/vendor/depot_tools/third_party/pylint/pyreverse/writer.py +3 -4
- data/vendor/depot_tools/third_party/pylint/reporters/__init__.py +34 -18
- data/vendor/depot_tools/third_party/pylint/reporters/guireporter.py +1 -1
- data/vendor/depot_tools/third_party/pylint/reporters/html.py +10 -3
- data/vendor/depot_tools/third_party/pylint/reporters/json.py +10 -4
- data/vendor/depot_tools/third_party/pylint/reporters/text.py +94 -3
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/__init__.py +106 -0
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/html_writer.py +17 -57
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/nodes.py +52 -74
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/text_writer.py +14 -60
- data/vendor/depot_tools/third_party/pylint/testutils.py +22 -20
- data/vendor/depot_tools/third_party/pylint/utils.py +268 -44
- data/vendor/depot_tools/third_party/repo/progress.py +42 -0
- data/vendor/depot_tools/update_depot_tools +1 -1
- data/vendor/depot_tools/upload_metrics.py +25 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +45 -15
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +71 -24
- data/vendor/depot_tools/yapf +1 -1
- data/vendor/depot_tools/yapf.bat +1 -1
- metadata +92 -77
- data/vendor/depot_tools/git-crsync +0 -3
- data/vendor/depot_tools/infra/config/cq.cfg +0 -32
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref.json +0 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref_custom.json +0 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/buildbot.json +0 -105
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/shallow.json +0 -195
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +0 -248
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8.json +0 -248
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name_no_patch.json +0 -105
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/apply_gerrit.py +0 -33
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +0 -31
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2qt4.py +0 -22
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2stdlib.py +0 -334
- data/vendor/depot_tools/third_party/logilab/astroid/inspector.py +0 -273
- data/vendor/depot_tools/third_party/logilab/astroid/utils.py +0 -239
- data/vendor/depot_tools/third_party/logilab/common/LICENSE.txt +0 -339
- data/vendor/depot_tools/third_party/logilab/common/README.chromium +0 -11
- data/vendor/depot_tools/third_party/logilab/common/__init__.py +0 -175
- data/vendor/depot_tools/third_party/logilab/common/__pkginfo__.py +0 -57
- data/vendor/depot_tools/third_party/logilab/common/cache.py +0 -114
- data/vendor/depot_tools/third_party/logilab/common/changelog.py +0 -238
- data/vendor/depot_tools/third_party/logilab/common/clcommands.py +0 -334
- data/vendor/depot_tools/third_party/logilab/common/cli.py +0 -211
- data/vendor/depot_tools/third_party/logilab/common/compat.py +0 -78
- data/vendor/depot_tools/third_party/logilab/common/configuration.py +0 -1105
- data/vendor/depot_tools/third_party/logilab/common/contexts.py +0 -5
- data/vendor/depot_tools/third_party/logilab/common/corbautils.py +0 -117
- data/vendor/depot_tools/third_party/logilab/common/daemon.py +0 -101
- data/vendor/depot_tools/third_party/logilab/common/date.py +0 -335
- data/vendor/depot_tools/third_party/logilab/common/dbf.py +0 -231
- data/vendor/depot_tools/third_party/logilab/common/debugger.py +0 -214
- data/vendor/depot_tools/third_party/logilab/common/decorators.py +0 -281
- data/vendor/depot_tools/third_party/logilab/common/deprecation.py +0 -189
- data/vendor/depot_tools/third_party/logilab/common/fileutils.py +0 -404
- data/vendor/depot_tools/third_party/logilab/common/interface.py +0 -71
- data/vendor/depot_tools/third_party/logilab/common/logging_ext.py +0 -195
- data/vendor/depot_tools/third_party/logilab/common/modutils.py +0 -702
- data/vendor/depot_tools/third_party/logilab/common/optik_ext.py +0 -392
- data/vendor/depot_tools/third_party/logilab/common/optparser.py +0 -92
- data/vendor/depot_tools/third_party/logilab/common/proc.py +0 -277
- data/vendor/depot_tools/third_party/logilab/common/pyro_ext.py +0 -180
- data/vendor/depot_tools/third_party/logilab/common/pytest.py +0 -1199
- data/vendor/depot_tools/third_party/logilab/common/registry.py +0 -1119
- data/vendor/depot_tools/third_party/logilab/common/shellutils.py +0 -462
- data/vendor/depot_tools/third_party/logilab/common/sphinx_ext.py +0 -87
- data/vendor/depot_tools/third_party/logilab/common/sphinxutils.py +0 -122
- data/vendor/depot_tools/third_party/logilab/common/table.py +0 -929
- data/vendor/depot_tools/third_party/logilab/common/tasksqueue.py +0 -101
- data/vendor/depot_tools/third_party/logilab/common/testlib.py +0 -1392
- data/vendor/depot_tools/third_party/logilab/common/textutils.py +0 -537
- data/vendor/depot_tools/third_party/logilab/common/tree.py +0 -369
- data/vendor/depot_tools/third_party/logilab/common/umessage.py +0 -194
- data/vendor/depot_tools/third_party/logilab/common/ureports/__init__.py +0 -172
- data/vendor/depot_tools/third_party/logilab/common/ureports/docbook_writer.py +0 -140
- data/vendor/depot_tools/third_party/logilab/common/urllib2ext.py +0 -89
- data/vendor/depot_tools/third_party/logilab/common/visitor.py +0 -109
- data/vendor/depot_tools/third_party/logilab/common/xmlrpcutils.py +0 -131
- data/vendor/depot_tools/third_party/logilab/common/xmlutils.py +0 -61
@@ -0,0 +1,246 @@
|
|
1
|
+
import operator
|
2
|
+
|
3
|
+
from .compat import PY2
|
4
|
+
from .compat import PY3
|
5
|
+
from .compat import with_metaclass
|
6
|
+
from .utils import cached_property
|
7
|
+
from .utils import identity
|
8
|
+
|
9
|
+
|
10
|
+
def make_proxy_method(code):
|
11
|
+
def proxy_wrapper(self, *args):
|
12
|
+
return code(self.__wrapped__, *args)
|
13
|
+
|
14
|
+
return proxy_wrapper
|
15
|
+
|
16
|
+
|
17
|
+
class _ProxyMethods(object):
|
18
|
+
# We use properties to override the values of __module__ and
|
19
|
+
# __doc__. If we add these in ObjectProxy, the derived class
|
20
|
+
# __dict__ will still be setup to have string variants of these
|
21
|
+
# attributes and the rules of descriptors means that they appear to
|
22
|
+
# take precedence over the properties in the base class. To avoid
|
23
|
+
# that, we copy the properties into the derived class type itself
|
24
|
+
# via a meta class. In that way the properties will always take
|
25
|
+
# precedence.
|
26
|
+
|
27
|
+
@property
|
28
|
+
def __module__(self):
|
29
|
+
return self.__wrapped__.__module__
|
30
|
+
|
31
|
+
@__module__.setter
|
32
|
+
def __module__(self, value):
|
33
|
+
self.__wrapped__.__module__ = value
|
34
|
+
|
35
|
+
@property
|
36
|
+
def __doc__(self):
|
37
|
+
return self.__wrapped__.__doc__
|
38
|
+
|
39
|
+
@__doc__.setter
|
40
|
+
def __doc__(self, value):
|
41
|
+
self.__wrapped__.__doc__ = value
|
42
|
+
|
43
|
+
# Need to also propagate the special __weakref__ attribute for case
|
44
|
+
# where decorating classes which will define this. If do not define
|
45
|
+
# it and use a function like inspect.getmembers() on a decorator
|
46
|
+
# class it will fail. This can't be in the derived classes.
|
47
|
+
|
48
|
+
@property
|
49
|
+
def __weakref__(self):
|
50
|
+
return self.__wrapped__.__weakref__
|
51
|
+
|
52
|
+
|
53
|
+
class _ProxyMetaType(type):
|
54
|
+
def __new__(cls, name, bases, dictionary):
|
55
|
+
# Copy our special properties into the class so that they
|
56
|
+
# always take precedence over attributes of the same name added
|
57
|
+
# during construction of a derived class. This is to save
|
58
|
+
# duplicating the implementation for them in all derived classes.
|
59
|
+
|
60
|
+
dictionary.update(vars(_ProxyMethods))
|
61
|
+
dictionary.pop('__dict__')
|
62
|
+
|
63
|
+
return type.__new__(cls, name, bases, dictionary)
|
64
|
+
|
65
|
+
|
66
|
+
class Proxy(with_metaclass(_ProxyMetaType)):
|
67
|
+
__factory__ = None
|
68
|
+
|
69
|
+
def __init__(self, factory):
|
70
|
+
self.__dict__['__factory__'] = factory
|
71
|
+
|
72
|
+
@cached_property
|
73
|
+
def __wrapped__(self):
|
74
|
+
self = self.__dict__
|
75
|
+
if '__factory__' in self:
|
76
|
+
factory = self['__factory__']
|
77
|
+
return factory()
|
78
|
+
else:
|
79
|
+
raise ValueError("Proxy hasn't been initiated: __factory__ is missing.")
|
80
|
+
|
81
|
+
__name__ = property(make_proxy_method(operator.attrgetter('__name__')))
|
82
|
+
__class__ = property(make_proxy_method(operator.attrgetter('__class__')))
|
83
|
+
__annotations__ = property(make_proxy_method(operator.attrgetter('__anotations__')))
|
84
|
+
__dir__ = make_proxy_method(dir)
|
85
|
+
__str__ = make_proxy_method(str)
|
86
|
+
|
87
|
+
if PY3:
|
88
|
+
__bytes__ = make_proxy_method(bytes)
|
89
|
+
|
90
|
+
def __repr__(self, __getattr__=object.__getattribute__):
|
91
|
+
if '__wrapped__' in self.__dict__:
|
92
|
+
return '<%s at 0x%x wrapping %r at 0x%x with factory %r>' % (
|
93
|
+
type(self).__name__, id(self),
|
94
|
+
self.__wrapped__, id(self.__wrapped__),
|
95
|
+
self.__factory__
|
96
|
+
)
|
97
|
+
else:
|
98
|
+
return '<%s at 0x%x with factory %r>' % (
|
99
|
+
type(self).__name__, id(self),
|
100
|
+
self.__factory__
|
101
|
+
)
|
102
|
+
|
103
|
+
__reversed__ = make_proxy_method(reversed)
|
104
|
+
|
105
|
+
if PY3:
|
106
|
+
__round__ = make_proxy_method(round)
|
107
|
+
|
108
|
+
__lt__ = make_proxy_method(operator.lt)
|
109
|
+
__le__ = make_proxy_method(operator.le)
|
110
|
+
__eq__ = make_proxy_method(operator.eq)
|
111
|
+
__ne__ = make_proxy_method(operator.ne)
|
112
|
+
__gt__ = make_proxy_method(operator.gt)
|
113
|
+
__ge__ = make_proxy_method(operator.ge)
|
114
|
+
__hash__ = make_proxy_method(hash)
|
115
|
+
__nonzero__ = make_proxy_method(bool)
|
116
|
+
__bool__ = make_proxy_method(bool)
|
117
|
+
|
118
|
+
def __setattr__(self, name, value):
|
119
|
+
if hasattr(type(self), name):
|
120
|
+
self.__dict__[name] = value
|
121
|
+
else:
|
122
|
+
setattr(self.__wrapped__, name, value)
|
123
|
+
|
124
|
+
def __getattr__(self, name):
|
125
|
+
if name in ('__wrapped__', '__factory__'):
|
126
|
+
raise AttributeError(name)
|
127
|
+
else:
|
128
|
+
return getattr(self.__wrapped__, name)
|
129
|
+
|
130
|
+
def __delattr__(self, name):
|
131
|
+
if hasattr(type(self), name):
|
132
|
+
del self.__dict__[name]
|
133
|
+
else:
|
134
|
+
delattr(self.__wrapped__, name)
|
135
|
+
|
136
|
+
__add__ = make_proxy_method(operator.add)
|
137
|
+
__sub__ = make_proxy_method(operator.sub)
|
138
|
+
__mul__ = make_proxy_method(operator.mul)
|
139
|
+
__div__ = make_proxy_method(operator.div if PY2 else operator.truediv)
|
140
|
+
__truediv__ = make_proxy_method(operator.truediv)
|
141
|
+
__floordiv__ = make_proxy_method(operator.floordiv)
|
142
|
+
__mod__ = make_proxy_method(operator.mod)
|
143
|
+
__divmod__ = make_proxy_method(divmod)
|
144
|
+
__pow__ = make_proxy_method(pow)
|
145
|
+
__lshift__ = make_proxy_method(operator.lshift)
|
146
|
+
__rshift__ = make_proxy_method(operator.rshift)
|
147
|
+
__and__ = make_proxy_method(operator.and_)
|
148
|
+
__xor__ = make_proxy_method(operator.xor)
|
149
|
+
__or__ = make_proxy_method(operator.or_)
|
150
|
+
|
151
|
+
def __radd__(self, other):
|
152
|
+
return other + self.__wrapped__
|
153
|
+
|
154
|
+
def __rsub__(self, other):
|
155
|
+
return other - self.__wrapped__
|
156
|
+
|
157
|
+
def __rmul__(self, other):
|
158
|
+
return other * self.__wrapped__
|
159
|
+
|
160
|
+
def __rdiv__(self, other):
|
161
|
+
return operator.div(other, self.__wrapped__)
|
162
|
+
|
163
|
+
def __rtruediv__(self, other):
|
164
|
+
return operator.truediv(other, self.__wrapped__)
|
165
|
+
|
166
|
+
def __rfloordiv__(self, other):
|
167
|
+
return other // self.__wrapped__
|
168
|
+
|
169
|
+
def __rmod__(self, other):
|
170
|
+
return other % self.__wrapped__
|
171
|
+
|
172
|
+
def __rdivmod__(self, other):
|
173
|
+
return divmod(other, self.__wrapped__)
|
174
|
+
|
175
|
+
def __rpow__(self, other, *args):
|
176
|
+
return pow(other, self.__wrapped__, *args)
|
177
|
+
|
178
|
+
def __rlshift__(self, other):
|
179
|
+
return other << self.__wrapped__
|
180
|
+
|
181
|
+
def __rrshift__(self, other):
|
182
|
+
return other >> self.__wrapped__
|
183
|
+
|
184
|
+
def __rand__(self, other):
|
185
|
+
return other & self.__wrapped__
|
186
|
+
|
187
|
+
def __rxor__(self, other):
|
188
|
+
return other ^ self.__wrapped__
|
189
|
+
|
190
|
+
def __ror__(self, other):
|
191
|
+
return other | self.__wrapped__
|
192
|
+
|
193
|
+
__iadd__ = make_proxy_method(operator.iadd)
|
194
|
+
__isub__ = make_proxy_method(operator.isub)
|
195
|
+
__imul__ = make_proxy_method(operator.imul)
|
196
|
+
__idiv__ = make_proxy_method(operator.idiv if PY2 else operator.itruediv)
|
197
|
+
__itruediv__ = make_proxy_method(operator.itruediv)
|
198
|
+
__ifloordiv__ = make_proxy_method(operator.ifloordiv)
|
199
|
+
__imod__ = make_proxy_method(operator.imod)
|
200
|
+
__ipow__ = make_proxy_method(operator.ipow)
|
201
|
+
__ilshift__ = make_proxy_method(operator.ilshift)
|
202
|
+
__irshift__ = make_proxy_method(operator.irshift)
|
203
|
+
__iand__ = make_proxy_method(operator.iand)
|
204
|
+
__ixor__ = make_proxy_method(operator.ixor)
|
205
|
+
__ior__ = make_proxy_method(operator.ior)
|
206
|
+
__neg__ = make_proxy_method(operator.neg)
|
207
|
+
__pos__ = make_proxy_method(operator.pos)
|
208
|
+
__abs__ = make_proxy_method(operator.abs)
|
209
|
+
__invert__ = make_proxy_method(operator.invert)
|
210
|
+
|
211
|
+
__int__ = make_proxy_method(int)
|
212
|
+
|
213
|
+
if PY2:
|
214
|
+
__long__ = make_proxy_method(long) # flake8: noqa
|
215
|
+
|
216
|
+
__float__ = make_proxy_method(float)
|
217
|
+
__oct__ = make_proxy_method(oct)
|
218
|
+
__hex__ = make_proxy_method(hex)
|
219
|
+
__index__ = make_proxy_method(operator.index)
|
220
|
+
__len__ = make_proxy_method(len)
|
221
|
+
__contains__ = make_proxy_method(operator.contains)
|
222
|
+
__getitem__ = make_proxy_method(operator.getitem)
|
223
|
+
__setitem__ = make_proxy_method(operator.setitem)
|
224
|
+
__delitem__ = make_proxy_method(operator.delitem)
|
225
|
+
|
226
|
+
if PY2:
|
227
|
+
__getslice__ = make_proxy_method(operator.getslice)
|
228
|
+
__setslice__ = make_proxy_method(operator.setslice)
|
229
|
+
__delslice__ = make_proxy_method(operator.delslice)
|
230
|
+
|
231
|
+
def __enter__(self):
|
232
|
+
return self.__wrapped__.__enter__()
|
233
|
+
|
234
|
+
def __exit__(self, *args, **kwargs):
|
235
|
+
return self.__wrapped__.__exit__(*args, **kwargs)
|
236
|
+
|
237
|
+
__iter__ = make_proxy_method(iter)
|
238
|
+
|
239
|
+
def __call__(self, *args, **kwargs):
|
240
|
+
return self.__wrapped__(*args, **kwargs)
|
241
|
+
|
242
|
+
def __reduce__(self):
|
243
|
+
return identity, (self.__wrapped__,)
|
244
|
+
|
245
|
+
def __reduce_ex__(self, protocol):
|
246
|
+
return identity, (self.__wrapped__,)
|
@@ -0,0 +1,414 @@
|
|
1
|
+
import operator
|
2
|
+
|
3
|
+
from .compat import PY2
|
4
|
+
from .compat import PY3
|
5
|
+
from .compat import with_metaclass
|
6
|
+
from .utils import identity
|
7
|
+
|
8
|
+
|
9
|
+
class _ProxyMethods(object):
|
10
|
+
# We use properties to override the values of __module__ and
|
11
|
+
# __doc__. If we add these in ObjectProxy, the derived class
|
12
|
+
# __dict__ will still be setup to have string variants of these
|
13
|
+
# attributes and the rules of descriptors means that they appear to
|
14
|
+
# take precedence over the properties in the base class. To avoid
|
15
|
+
# that, we copy the properties into the derived class type itself
|
16
|
+
# via a meta class. In that way the properties will always take
|
17
|
+
# precedence.
|
18
|
+
|
19
|
+
@property
|
20
|
+
def __module__(self):
|
21
|
+
return self.__wrapped__.__module__
|
22
|
+
|
23
|
+
@__module__.setter
|
24
|
+
def __module__(self, value):
|
25
|
+
self.__wrapped__.__module__ = value
|
26
|
+
|
27
|
+
@property
|
28
|
+
def __doc__(self):
|
29
|
+
return self.__wrapped__.__doc__
|
30
|
+
|
31
|
+
@__doc__.setter
|
32
|
+
def __doc__(self, value):
|
33
|
+
self.__wrapped__.__doc__ = value
|
34
|
+
|
35
|
+
# We similar use a property for __dict__. We need __dict__ to be
|
36
|
+
# explicit to ensure that vars() works as expected.
|
37
|
+
|
38
|
+
@property
|
39
|
+
def __dict__(self):
|
40
|
+
return self.__wrapped__.__dict__
|
41
|
+
|
42
|
+
# Need to also propagate the special __weakref__ attribute for case
|
43
|
+
# where decorating classes which will define this. If do not define
|
44
|
+
# it and use a function like inspect.getmembers() on a decorator
|
45
|
+
# class it will fail. This can't be in the derived classes.
|
46
|
+
|
47
|
+
@property
|
48
|
+
def __weakref__(self):
|
49
|
+
return self.__wrapped__.__weakref__
|
50
|
+
|
51
|
+
|
52
|
+
class _ProxyMetaType(type):
|
53
|
+
def __new__(cls, name, bases, dictionary):
|
54
|
+
# Copy our special properties into the class so that they
|
55
|
+
# always take precedence over attributes of the same name added
|
56
|
+
# during construction of a derived class. This is to save
|
57
|
+
# duplicating the implementation for them in all derived classes.
|
58
|
+
|
59
|
+
dictionary.update(vars(_ProxyMethods))
|
60
|
+
|
61
|
+
return type.__new__(cls, name, bases, dictionary)
|
62
|
+
|
63
|
+
|
64
|
+
class Proxy(with_metaclass(_ProxyMetaType)):
|
65
|
+
"""
|
66
|
+
A proxy implementation in pure Python, using slots. You can subclass this to add
|
67
|
+
local methods or attributes, or enable __dict__.
|
68
|
+
|
69
|
+
The most important internals:
|
70
|
+
|
71
|
+
* ``__factory__`` is the callback that "materializes" the object we proxy to.
|
72
|
+
* ``__target__`` will contain the object we proxy to, once it's "materialized".
|
73
|
+
* ``__wrapped__`` is a property that does either:
|
74
|
+
|
75
|
+
* return ``__target__`` if it's set.
|
76
|
+
* calls ``__factory__``, saves result to ``__target__`` and returns said result.
|
77
|
+
"""
|
78
|
+
|
79
|
+
__slots__ = '__target__', '__factory__'
|
80
|
+
|
81
|
+
def __init__(self, factory):
|
82
|
+
object.__setattr__(self, '__factory__', factory)
|
83
|
+
|
84
|
+
@property
|
85
|
+
def __wrapped__(self, __getattr__=object.__getattribute__, __setattr__=object.__setattr__,
|
86
|
+
__delattr__=object.__delattr__):
|
87
|
+
try:
|
88
|
+
return __getattr__(self, '__target__')
|
89
|
+
except AttributeError:
|
90
|
+
try:
|
91
|
+
factory = __getattr__(self, '__factory__')
|
92
|
+
except AttributeError:
|
93
|
+
raise ValueError("Proxy hasn't been initiated: __factory__ is missing.")
|
94
|
+
target = factory()
|
95
|
+
__setattr__(self, '__target__', target)
|
96
|
+
return target
|
97
|
+
|
98
|
+
@__wrapped__.deleter
|
99
|
+
def __wrapped__(self, __delattr__=object.__delattr__):
|
100
|
+
__delattr__(self, '__target__')
|
101
|
+
|
102
|
+
@__wrapped__.setter
|
103
|
+
def __wrapped__(self, target, __setattr__=object.__setattr__):
|
104
|
+
__setattr__(self, '__target__', target)
|
105
|
+
|
106
|
+
@property
|
107
|
+
def __name__(self):
|
108
|
+
return self.__wrapped__.__name__
|
109
|
+
|
110
|
+
@__name__.setter
|
111
|
+
def __name__(self, value):
|
112
|
+
self.__wrapped__.__name__ = value
|
113
|
+
|
114
|
+
@property
|
115
|
+
def __class__(self):
|
116
|
+
return self.__wrapped__.__class__
|
117
|
+
|
118
|
+
@__class__.setter
|
119
|
+
def __class__(self, value):
|
120
|
+
self.__wrapped__.__class__ = value
|
121
|
+
|
122
|
+
@property
|
123
|
+
def __annotations__(self):
|
124
|
+
return self.__wrapped__.__anotations__
|
125
|
+
|
126
|
+
@__annotations__.setter
|
127
|
+
def __annotations__(self, value):
|
128
|
+
self.__wrapped__.__annotations__ = value
|
129
|
+
|
130
|
+
def __dir__(self):
|
131
|
+
return dir(self.__wrapped__)
|
132
|
+
|
133
|
+
def __str__(self):
|
134
|
+
return str(self.__wrapped__)
|
135
|
+
|
136
|
+
if PY3:
|
137
|
+
def __bytes__(self):
|
138
|
+
return bytes(self.__wrapped__)
|
139
|
+
|
140
|
+
def __repr__(self, __getattr__=object.__getattribute__):
|
141
|
+
try:
|
142
|
+
target = __getattr__(self, '__target__')
|
143
|
+
except AttributeError:
|
144
|
+
return '<%s at 0x%x with factory %r>' % (
|
145
|
+
type(self).__name__, id(self),
|
146
|
+
self.__factory__
|
147
|
+
)
|
148
|
+
else:
|
149
|
+
return '<%s at 0x%x wrapping %r at 0x%x with factory %r>' % (
|
150
|
+
type(self).__name__, id(self),
|
151
|
+
target, id(target),
|
152
|
+
self.__factory__
|
153
|
+
)
|
154
|
+
|
155
|
+
def __reversed__(self):
|
156
|
+
return reversed(self.__wrapped__)
|
157
|
+
|
158
|
+
if PY3:
|
159
|
+
def __round__(self):
|
160
|
+
return round(self.__wrapped__)
|
161
|
+
|
162
|
+
def __lt__(self, other):
|
163
|
+
return self.__wrapped__ < other
|
164
|
+
|
165
|
+
def __le__(self, other):
|
166
|
+
return self.__wrapped__ <= other
|
167
|
+
|
168
|
+
def __eq__(self, other):
|
169
|
+
return self.__wrapped__ == other
|
170
|
+
|
171
|
+
def __ne__(self, other):
|
172
|
+
return self.__wrapped__ != other
|
173
|
+
|
174
|
+
def __gt__(self, other):
|
175
|
+
return self.__wrapped__ > other
|
176
|
+
|
177
|
+
def __ge__(self, other):
|
178
|
+
return self.__wrapped__ >= other
|
179
|
+
|
180
|
+
def __hash__(self):
|
181
|
+
return hash(self.__wrapped__)
|
182
|
+
|
183
|
+
def __nonzero__(self):
|
184
|
+
return bool(self.__wrapped__)
|
185
|
+
|
186
|
+
def __bool__(self):
|
187
|
+
return bool(self.__wrapped__)
|
188
|
+
|
189
|
+
def __setattr__(self, name, value, __setattr__=object.__setattr__):
|
190
|
+
if hasattr(type(self), name):
|
191
|
+
__setattr__(self, name, value)
|
192
|
+
else:
|
193
|
+
setattr(self.__wrapped__, name, value)
|
194
|
+
|
195
|
+
def __getattr__(self, name):
|
196
|
+
if name in ('__wrapped__', '__factory__'):
|
197
|
+
raise AttributeError(name)
|
198
|
+
else:
|
199
|
+
return getattr(self.__wrapped__, name)
|
200
|
+
|
201
|
+
def __delattr__(self, name, __delattr__=object.__delattr__):
|
202
|
+
if hasattr(type(self), name):
|
203
|
+
__delattr__(self, name)
|
204
|
+
else:
|
205
|
+
delattr(self.__wrapped__, name)
|
206
|
+
|
207
|
+
def __add__(self, other):
|
208
|
+
return self.__wrapped__ + other
|
209
|
+
|
210
|
+
def __sub__(self, other):
|
211
|
+
return self.__wrapped__ - other
|
212
|
+
|
213
|
+
def __mul__(self, other):
|
214
|
+
return self.__wrapped__ * other
|
215
|
+
|
216
|
+
def __div__(self, other):
|
217
|
+
return operator.div(self.__wrapped__, other)
|
218
|
+
|
219
|
+
def __truediv__(self, other):
|
220
|
+
return operator.truediv(self.__wrapped__, other)
|
221
|
+
|
222
|
+
def __floordiv__(self, other):
|
223
|
+
return self.__wrapped__ // other
|
224
|
+
|
225
|
+
def __mod__(self, other):
|
226
|
+
return self.__wrapped__ ^ other
|
227
|
+
|
228
|
+
def __divmod__(self, other):
|
229
|
+
return divmod(self.__wrapped__, other)
|
230
|
+
|
231
|
+
def __pow__(self, other, *args):
|
232
|
+
return pow(self.__wrapped__, other, *args)
|
233
|
+
|
234
|
+
def __lshift__(self, other):
|
235
|
+
return self.__wrapped__ << other
|
236
|
+
|
237
|
+
def __rshift__(self, other):
|
238
|
+
return self.__wrapped__ >> other
|
239
|
+
|
240
|
+
def __and__(self, other):
|
241
|
+
return self.__wrapped__ & other
|
242
|
+
|
243
|
+
def __xor__(self, other):
|
244
|
+
return self.__wrapped__ ^ other
|
245
|
+
|
246
|
+
def __or__(self, other):
|
247
|
+
return self.__wrapped__ | other
|
248
|
+
|
249
|
+
def __radd__(self, other):
|
250
|
+
return other + self.__wrapped__
|
251
|
+
|
252
|
+
def __rsub__(self, other):
|
253
|
+
return other - self.__wrapped__
|
254
|
+
|
255
|
+
def __rmul__(self, other):
|
256
|
+
return other * self.__wrapped__
|
257
|
+
|
258
|
+
def __rdiv__(self, other):
|
259
|
+
return operator.div(other, self.__wrapped__)
|
260
|
+
|
261
|
+
def __rtruediv__(self, other):
|
262
|
+
return operator.truediv(other, self.__wrapped__)
|
263
|
+
|
264
|
+
def __rfloordiv__(self, other):
|
265
|
+
return other // self.__wrapped__
|
266
|
+
|
267
|
+
def __rmod__(self, other):
|
268
|
+
return other % self.__wrapped__
|
269
|
+
|
270
|
+
def __rdivmod__(self, other):
|
271
|
+
return divmod(other, self.__wrapped__)
|
272
|
+
|
273
|
+
def __rpow__(self, other, *args):
|
274
|
+
return pow(other, self.__wrapped__, *args)
|
275
|
+
|
276
|
+
def __rlshift__(self, other):
|
277
|
+
return other << self.__wrapped__
|
278
|
+
|
279
|
+
def __rrshift__(self, other):
|
280
|
+
return other >> self.__wrapped__
|
281
|
+
|
282
|
+
def __rand__(self, other):
|
283
|
+
return other & self.__wrapped__
|
284
|
+
|
285
|
+
def __rxor__(self, other):
|
286
|
+
return other ^ self.__wrapped__
|
287
|
+
|
288
|
+
def __ror__(self, other):
|
289
|
+
return other | self.__wrapped__
|
290
|
+
|
291
|
+
def __iadd__(self, other):
|
292
|
+
self.__wrapped__ += other
|
293
|
+
return self
|
294
|
+
|
295
|
+
def __isub__(self, other):
|
296
|
+
self.__wrapped__ -= other
|
297
|
+
return self
|
298
|
+
|
299
|
+
def __imul__(self, other):
|
300
|
+
self.__wrapped__ *= other
|
301
|
+
return self
|
302
|
+
|
303
|
+
def __idiv__(self, other):
|
304
|
+
self.__wrapped__ = operator.idiv(self.__wrapped__, other)
|
305
|
+
return self
|
306
|
+
|
307
|
+
def __itruediv__(self, other):
|
308
|
+
self.__wrapped__ = operator.itruediv(self.__wrapped__, other)
|
309
|
+
return self
|
310
|
+
|
311
|
+
def __ifloordiv__(self, other):
|
312
|
+
self.__wrapped__ //= other
|
313
|
+
return self
|
314
|
+
|
315
|
+
def __imod__(self, other):
|
316
|
+
self.__wrapped__ %= other
|
317
|
+
return self
|
318
|
+
|
319
|
+
def __ipow__(self, other):
|
320
|
+
self.__wrapped__ **= other
|
321
|
+
return self
|
322
|
+
|
323
|
+
def __ilshift__(self, other):
|
324
|
+
self.__wrapped__ <<= other
|
325
|
+
return self
|
326
|
+
|
327
|
+
def __irshift__(self, other):
|
328
|
+
self.__wrapped__ >>= other
|
329
|
+
return self
|
330
|
+
|
331
|
+
def __iand__(self, other):
|
332
|
+
self.__wrapped__ &= other
|
333
|
+
return self
|
334
|
+
|
335
|
+
def __ixor__(self, other):
|
336
|
+
self.__wrapped__ ^= other
|
337
|
+
return self
|
338
|
+
|
339
|
+
def __ior__(self, other):
|
340
|
+
self.__wrapped__ |= other
|
341
|
+
return self
|
342
|
+
|
343
|
+
def __neg__(self):
|
344
|
+
return -self.__wrapped__
|
345
|
+
|
346
|
+
def __pos__(self):
|
347
|
+
return +self.__wrapped__
|
348
|
+
|
349
|
+
def __abs__(self):
|
350
|
+
return abs(self.__wrapped__)
|
351
|
+
|
352
|
+
def __invert__(self):
|
353
|
+
return ~self.__wrapped__
|
354
|
+
|
355
|
+
def __int__(self):
|
356
|
+
return int(self.__wrapped__)
|
357
|
+
|
358
|
+
if PY2:
|
359
|
+
def __long__(self):
|
360
|
+
return long(self.__wrapped__) # flake8: noqa
|
361
|
+
|
362
|
+
def __float__(self):
|
363
|
+
return float(self.__wrapped__)
|
364
|
+
|
365
|
+
def __oct__(self):
|
366
|
+
return oct(self.__wrapped__)
|
367
|
+
|
368
|
+
def __hex__(self):
|
369
|
+
return hex(self.__wrapped__)
|
370
|
+
|
371
|
+
def __index__(self):
|
372
|
+
return operator.index(self.__wrapped__)
|
373
|
+
|
374
|
+
def __len__(self):
|
375
|
+
return len(self.__wrapped__)
|
376
|
+
|
377
|
+
def __contains__(self, value):
|
378
|
+
return value in self.__wrapped__
|
379
|
+
|
380
|
+
def __getitem__(self, key):
|
381
|
+
return self.__wrapped__[key]
|
382
|
+
|
383
|
+
def __setitem__(self, key, value):
|
384
|
+
self.__wrapped__[key] = value
|
385
|
+
|
386
|
+
def __delitem__(self, key):
|
387
|
+
del self.__wrapped__[key]
|
388
|
+
|
389
|
+
def __getslice__(self, i, j):
|
390
|
+
return self.__wrapped__[i:j]
|
391
|
+
|
392
|
+
def __setslice__(self, i, j, value):
|
393
|
+
self.__wrapped__[i:j] = value
|
394
|
+
|
395
|
+
def __delslice__(self, i, j):
|
396
|
+
del self.__wrapped__[i:j]
|
397
|
+
|
398
|
+
def __enter__(self):
|
399
|
+
return self.__wrapped__.__enter__()
|
400
|
+
|
401
|
+
def __exit__(self, *args, **kwargs):
|
402
|
+
return self.__wrapped__.__exit__(*args, **kwargs)
|
403
|
+
|
404
|
+
def __iter__(self):
|
405
|
+
return iter(self.__wrapped__)
|
406
|
+
|
407
|
+
def __call__(self, *args, **kwargs):
|
408
|
+
return self.__wrapped__(*args, **kwargs)
|
409
|
+
|
410
|
+
def __reduce__(self):
|
411
|
+
return identity, (self.__wrapped__,)
|
412
|
+
|
413
|
+
def __reduce_ex__(self, protocol):
|
414
|
+
return identity, (self.__wrapped__,)
|