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
@@ -1,57 +0,0 @@
|
|
1
|
-
# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
-
#
|
4
|
-
# This file is part of logilab-common.
|
5
|
-
#
|
6
|
-
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
-
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
-
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
-
# later version.
|
10
|
-
#
|
11
|
-
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
-
# details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
-
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
"""logilab.common packaging information"""
|
19
|
-
__docformat__ = "restructuredtext en"
|
20
|
-
import sys
|
21
|
-
import os
|
22
|
-
|
23
|
-
distname = 'logilab-common'
|
24
|
-
modname = 'common'
|
25
|
-
subpackage_of = 'logilab'
|
26
|
-
subpackage_master = True
|
27
|
-
|
28
|
-
numversion = (0, 63, 2)
|
29
|
-
version = '.'.join([str(num) for num in numversion])
|
30
|
-
|
31
|
-
license = 'LGPL' # 2.1 or later
|
32
|
-
description = "collection of low-level Python packages and modules used by Logilab projects"
|
33
|
-
web = "http://www.logilab.org/project/%s" % distname
|
34
|
-
mailinglist = "mailto://python-projects@lists.logilab.org"
|
35
|
-
author = "Logilab"
|
36
|
-
author_email = "contact@logilab.fr"
|
37
|
-
|
38
|
-
|
39
|
-
from os.path import join
|
40
|
-
scripts = [join('bin', 'pytest')]
|
41
|
-
include_dirs = [join('test', 'data')]
|
42
|
-
|
43
|
-
install_requires = [
|
44
|
-
'six >= 1.4.0',
|
45
|
-
]
|
46
|
-
test_require = ['pytz']
|
47
|
-
|
48
|
-
if sys.version_info < (2, 7):
|
49
|
-
install_requires.append('unittest2 >= 0.5.1')
|
50
|
-
if os.name == 'nt':
|
51
|
-
install_requires.append('colorama')
|
52
|
-
|
53
|
-
classifiers = ["Topic :: Utilities",
|
54
|
-
"Programming Language :: Python",
|
55
|
-
"Programming Language :: Python :: 2",
|
56
|
-
"Programming Language :: Python :: 3",
|
57
|
-
]
|
@@ -1,114 +0,0 @@
|
|
1
|
-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
-
#
|
4
|
-
# This file is part of logilab-common.
|
5
|
-
#
|
6
|
-
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
-
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
-
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
-
# later version.
|
10
|
-
#
|
11
|
-
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
-
# details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
-
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
"""Cache module, with a least recently used algorithm for the management of the
|
19
|
-
deletion of entries.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"""
|
25
|
-
__docformat__ = "restructuredtext en"
|
26
|
-
|
27
|
-
from threading import Lock
|
28
|
-
|
29
|
-
from logilab.common.decorators import locked
|
30
|
-
|
31
|
-
_marker = object()
|
32
|
-
|
33
|
-
class Cache(dict):
|
34
|
-
"""A dictionary like cache.
|
35
|
-
|
36
|
-
inv:
|
37
|
-
len(self._usage) <= self.size
|
38
|
-
len(self.data) <= self.size
|
39
|
-
"""
|
40
|
-
|
41
|
-
def __init__(self, size=100):
|
42
|
-
""" Warning : Cache.__init__() != dict.__init__().
|
43
|
-
Constructor does not take any arguments beside size.
|
44
|
-
"""
|
45
|
-
assert size >= 0, 'cache size must be >= 0 (0 meaning no caching)'
|
46
|
-
self.size = size
|
47
|
-
self._usage = []
|
48
|
-
self._lock = Lock()
|
49
|
-
super(Cache, self).__init__()
|
50
|
-
|
51
|
-
def _acquire(self):
|
52
|
-
self._lock.acquire()
|
53
|
-
|
54
|
-
def _release(self):
|
55
|
-
self._lock.release()
|
56
|
-
|
57
|
-
def _update_usage(self, key):
|
58
|
-
if not self._usage:
|
59
|
-
self._usage.append(key)
|
60
|
-
elif self._usage[-1] != key:
|
61
|
-
try:
|
62
|
-
self._usage.remove(key)
|
63
|
-
except ValueError:
|
64
|
-
# we are inserting a new key
|
65
|
-
# check the size of the dictionary
|
66
|
-
# and remove the oldest item in the cache
|
67
|
-
if self.size and len(self._usage) >= self.size:
|
68
|
-
super(Cache, self).__delitem__(self._usage[0])
|
69
|
-
del self._usage[0]
|
70
|
-
self._usage.append(key)
|
71
|
-
else:
|
72
|
-
pass # key is already the most recently used key
|
73
|
-
|
74
|
-
def __getitem__(self, key):
|
75
|
-
value = super(Cache, self).__getitem__(key)
|
76
|
-
self._update_usage(key)
|
77
|
-
return value
|
78
|
-
__getitem__ = locked(_acquire, _release)(__getitem__)
|
79
|
-
|
80
|
-
def __setitem__(self, key, item):
|
81
|
-
# Just make sure that size > 0 before inserting a new item in the cache
|
82
|
-
if self.size > 0:
|
83
|
-
super(Cache, self).__setitem__(key, item)
|
84
|
-
self._update_usage(key)
|
85
|
-
__setitem__ = locked(_acquire, _release)(__setitem__)
|
86
|
-
|
87
|
-
def __delitem__(self, key):
|
88
|
-
super(Cache, self).__delitem__(key)
|
89
|
-
self._usage.remove(key)
|
90
|
-
__delitem__ = locked(_acquire, _release)(__delitem__)
|
91
|
-
|
92
|
-
def clear(self):
|
93
|
-
super(Cache, self).clear()
|
94
|
-
self._usage = []
|
95
|
-
clear = locked(_acquire, _release)(clear)
|
96
|
-
|
97
|
-
def pop(self, key, default=_marker):
|
98
|
-
if key in self:
|
99
|
-
self._usage.remove(key)
|
100
|
-
#if default is _marker:
|
101
|
-
# return super(Cache, self).pop(key)
|
102
|
-
return super(Cache, self).pop(key, default)
|
103
|
-
pop = locked(_acquire, _release)(pop)
|
104
|
-
|
105
|
-
def popitem(self):
|
106
|
-
raise NotImplementedError()
|
107
|
-
|
108
|
-
def setdefault(self, key, default=None):
|
109
|
-
raise NotImplementedError()
|
110
|
-
|
111
|
-
def update(self, other):
|
112
|
-
raise NotImplementedError()
|
113
|
-
|
114
|
-
|
@@ -1,238 +0,0 @@
|
|
1
|
-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
-
#
|
4
|
-
# This file is part of logilab-common.
|
5
|
-
#
|
6
|
-
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
-
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
-
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
-
# later version.
|
10
|
-
#
|
11
|
-
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
-
# details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
-
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
"""Manipulation of upstream change log files.
|
19
|
-
|
20
|
-
The upstream change log files format handled is simpler than the one
|
21
|
-
often used such as those generated by the default Emacs changelog mode.
|
22
|
-
|
23
|
-
Sample ChangeLog format::
|
24
|
-
|
25
|
-
Change log for project Yoo
|
26
|
-
==========================
|
27
|
-
|
28
|
-
--
|
29
|
-
* add a new functionality
|
30
|
-
|
31
|
-
2002-02-01 -- 0.1.1
|
32
|
-
* fix bug #435454
|
33
|
-
* fix bug #434356
|
34
|
-
|
35
|
-
2002-01-01 -- 0.1
|
36
|
-
* initial release
|
37
|
-
|
38
|
-
|
39
|
-
There is 3 entries in this change log, one for each released version and one
|
40
|
-
for the next version (i.e. the current entry).
|
41
|
-
Each entry contains a set of messages corresponding to changes done in this
|
42
|
-
release.
|
43
|
-
All the non empty lines before the first entry are considered as the change
|
44
|
-
log title.
|
45
|
-
"""
|
46
|
-
|
47
|
-
__docformat__ = "restructuredtext en"
|
48
|
-
|
49
|
-
import sys
|
50
|
-
from stat import S_IWRITE
|
51
|
-
|
52
|
-
from six import string_types
|
53
|
-
|
54
|
-
BULLET = '*'
|
55
|
-
SUBBULLET = '-'
|
56
|
-
INDENT = ' ' * 4
|
57
|
-
|
58
|
-
class NoEntry(Exception):
|
59
|
-
"""raised when we are unable to find an entry"""
|
60
|
-
|
61
|
-
class EntryNotFound(Exception):
|
62
|
-
"""raised when we are unable to find a given entry"""
|
63
|
-
|
64
|
-
class Version(tuple):
|
65
|
-
"""simple class to handle soft version number has a tuple while
|
66
|
-
correctly printing it as X.Y.Z
|
67
|
-
"""
|
68
|
-
def __new__(cls, versionstr):
|
69
|
-
if isinstance(versionstr, string_types):
|
70
|
-
versionstr = versionstr.strip(' :') # XXX (syt) duh?
|
71
|
-
parsed = cls.parse(versionstr)
|
72
|
-
else:
|
73
|
-
parsed = versionstr
|
74
|
-
return tuple.__new__(cls, parsed)
|
75
|
-
|
76
|
-
@classmethod
|
77
|
-
def parse(cls, versionstr):
|
78
|
-
versionstr = versionstr.strip(' :')
|
79
|
-
try:
|
80
|
-
return [int(i) for i in versionstr.split('.')]
|
81
|
-
except ValueError as ex:
|
82
|
-
raise ValueError("invalid literal for version '%s' (%s)"%(versionstr, ex))
|
83
|
-
|
84
|
-
def __str__(self):
|
85
|
-
return '.'.join([str(i) for i in self])
|
86
|
-
|
87
|
-
# upstream change log #########################################################
|
88
|
-
|
89
|
-
class ChangeLogEntry(object):
|
90
|
-
"""a change log entry, i.e. a set of messages associated to a version and
|
91
|
-
its release date
|
92
|
-
"""
|
93
|
-
version_class = Version
|
94
|
-
|
95
|
-
def __init__(self, date=None, version=None, **kwargs):
|
96
|
-
self.__dict__.update(kwargs)
|
97
|
-
if version:
|
98
|
-
self.version = self.version_class(version)
|
99
|
-
else:
|
100
|
-
self.version = None
|
101
|
-
self.date = date
|
102
|
-
self.messages = []
|
103
|
-
|
104
|
-
def add_message(self, msg):
|
105
|
-
"""add a new message"""
|
106
|
-
self.messages.append(([msg], []))
|
107
|
-
|
108
|
-
def complete_latest_message(self, msg_suite):
|
109
|
-
"""complete the latest added message
|
110
|
-
"""
|
111
|
-
if not self.messages:
|
112
|
-
raise ValueError('unable to complete last message as there is no previous message)')
|
113
|
-
if self.messages[-1][1]: # sub messages
|
114
|
-
self.messages[-1][1][-1].append(msg_suite)
|
115
|
-
else: # message
|
116
|
-
self.messages[-1][0].append(msg_suite)
|
117
|
-
|
118
|
-
def add_sub_message(self, sub_msg, key=None):
|
119
|
-
if not self.messages:
|
120
|
-
raise ValueError('unable to complete last message as there is no previous message)')
|
121
|
-
if key is None:
|
122
|
-
self.messages[-1][1].append([sub_msg])
|
123
|
-
else:
|
124
|
-
raise NotImplementedError("sub message to specific key are not implemented yet")
|
125
|
-
|
126
|
-
def write(self, stream=sys.stdout):
|
127
|
-
"""write the entry to file """
|
128
|
-
stream.write('%s -- %s\n' % (self.date or '', self.version or ''))
|
129
|
-
for msg, sub_msgs in self.messages:
|
130
|
-
stream.write('%s%s %s\n' % (INDENT, BULLET, msg[0]))
|
131
|
-
stream.write(''.join(msg[1:]))
|
132
|
-
if sub_msgs:
|
133
|
-
stream.write('\n')
|
134
|
-
for sub_msg in sub_msgs:
|
135
|
-
stream.write('%s%s %s\n' % (INDENT * 2, SUBBULLET, sub_msg[0]))
|
136
|
-
stream.write(''.join(sub_msg[1:]))
|
137
|
-
stream.write('\n')
|
138
|
-
|
139
|
-
stream.write('\n\n')
|
140
|
-
|
141
|
-
class ChangeLog(object):
|
142
|
-
"""object representation of a whole ChangeLog file"""
|
143
|
-
|
144
|
-
entry_class = ChangeLogEntry
|
145
|
-
|
146
|
-
def __init__(self, changelog_file, title=''):
|
147
|
-
self.file = changelog_file
|
148
|
-
self.title = title
|
149
|
-
self.additional_content = ''
|
150
|
-
self.entries = []
|
151
|
-
self.load()
|
152
|
-
|
153
|
-
def __repr__(self):
|
154
|
-
return '<ChangeLog %s at %s (%s entries)>' % (self.file, id(self),
|
155
|
-
len(self.entries))
|
156
|
-
|
157
|
-
def add_entry(self, entry):
|
158
|
-
"""add a new entry to the change log"""
|
159
|
-
self.entries.append(entry)
|
160
|
-
|
161
|
-
def get_entry(self, version='', create=None):
|
162
|
-
""" return a given changelog entry
|
163
|
-
if version is omitted, return the current entry
|
164
|
-
"""
|
165
|
-
if not self.entries:
|
166
|
-
if version or not create:
|
167
|
-
raise NoEntry()
|
168
|
-
self.entries.append(self.entry_class())
|
169
|
-
if not version:
|
170
|
-
if self.entries[0].version and create is not None:
|
171
|
-
self.entries.insert(0, self.entry_class())
|
172
|
-
return self.entries[0]
|
173
|
-
version = self.version_class(version)
|
174
|
-
for entry in self.entries:
|
175
|
-
if entry.version == version:
|
176
|
-
return entry
|
177
|
-
raise EntryNotFound()
|
178
|
-
|
179
|
-
def add(self, msg, create=None):
|
180
|
-
"""add a new message to the latest opened entry"""
|
181
|
-
entry = self.get_entry(create=create)
|
182
|
-
entry.add_message(msg)
|
183
|
-
|
184
|
-
def load(self):
|
185
|
-
""" read a logilab's ChangeLog from file """
|
186
|
-
try:
|
187
|
-
stream = open(self.file)
|
188
|
-
except IOError:
|
189
|
-
return
|
190
|
-
last = None
|
191
|
-
expect_sub = False
|
192
|
-
for line in stream.readlines():
|
193
|
-
sline = line.strip()
|
194
|
-
words = sline.split()
|
195
|
-
# if new entry
|
196
|
-
if len(words) == 1 and words[0] == '--':
|
197
|
-
expect_sub = False
|
198
|
-
last = self.entry_class()
|
199
|
-
self.add_entry(last)
|
200
|
-
# if old entry
|
201
|
-
elif len(words) == 3 and words[1] == '--':
|
202
|
-
expect_sub = False
|
203
|
-
last = self.entry_class(words[0], words[2])
|
204
|
-
self.add_entry(last)
|
205
|
-
# if title
|
206
|
-
elif sline and last is None:
|
207
|
-
self.title = '%s%s' % (self.title, line)
|
208
|
-
# if new entry
|
209
|
-
elif sline and sline[0] == BULLET:
|
210
|
-
expect_sub = False
|
211
|
-
last.add_message(sline[1:].strip())
|
212
|
-
# if new sub_entry
|
213
|
-
elif expect_sub and sline and sline[0] == SUBBULLET:
|
214
|
-
last.add_sub_message(sline[1:].strip())
|
215
|
-
# if new line for current entry
|
216
|
-
elif sline and last.messages:
|
217
|
-
last.complete_latest_message(line)
|
218
|
-
else:
|
219
|
-
expect_sub = True
|
220
|
-
self.additional_content += line
|
221
|
-
stream.close()
|
222
|
-
|
223
|
-
def format_title(self):
|
224
|
-
return '%s\n\n' % self.title.strip()
|
225
|
-
|
226
|
-
def save(self):
|
227
|
-
"""write back change log"""
|
228
|
-
# filetutils isn't importable in appengine, so import locally
|
229
|
-
from logilab.common.fileutils import ensure_fs_mode
|
230
|
-
ensure_fs_mode(self.file, S_IWRITE)
|
231
|
-
self.write(open(self.file, 'w'))
|
232
|
-
|
233
|
-
def write(self, stream=sys.stdout):
|
234
|
-
"""write changelog to stream"""
|
235
|
-
stream.write(self.format_title())
|
236
|
-
for entry in self.entries:
|
237
|
-
entry.write(stream)
|
238
|
-
|
@@ -1,334 +0,0 @@
|
|
1
|
-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
-
#
|
4
|
-
# This file is part of logilab-common.
|
5
|
-
#
|
6
|
-
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
-
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
-
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
-
# later version.
|
10
|
-
#
|
11
|
-
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
-
# details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
-
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
"""Helper functions to support command line tools providing more than
|
19
|
-
one command.
|
20
|
-
|
21
|
-
e.g called as "tool command [options] args..." where <options> and <args> are
|
22
|
-
command'specific
|
23
|
-
"""
|
24
|
-
|
25
|
-
from __future__ import print_function
|
26
|
-
|
27
|
-
__docformat__ = "restructuredtext en"
|
28
|
-
|
29
|
-
import sys
|
30
|
-
import logging
|
31
|
-
from os.path import basename
|
32
|
-
|
33
|
-
from logilab.common.configuration import Configuration
|
34
|
-
from logilab.common.logging_ext import init_log, get_threshold
|
35
|
-
from logilab.common.deprecation import deprecated
|
36
|
-
|
37
|
-
|
38
|
-
class BadCommandUsage(Exception):
|
39
|
-
"""Raised when an unknown command is used or when a command is not
|
40
|
-
correctly used (bad options, too much / missing arguments...).
|
41
|
-
|
42
|
-
Trigger display of command usage.
|
43
|
-
"""
|
44
|
-
|
45
|
-
class CommandError(Exception):
|
46
|
-
"""Raised when a command can't be processed and we want to display it and
|
47
|
-
exit, without traceback nor usage displayed.
|
48
|
-
"""
|
49
|
-
|
50
|
-
|
51
|
-
# command line access point ####################################################
|
52
|
-
|
53
|
-
class CommandLine(dict):
|
54
|
-
"""Usage:
|
55
|
-
|
56
|
-
>>> LDI = cli.CommandLine('ldi', doc='Logilab debian installer',
|
57
|
-
version=version, rcfile=RCFILE)
|
58
|
-
>>> LDI.register(MyCommandClass)
|
59
|
-
>>> LDI.register(MyOtherCommandClass)
|
60
|
-
>>> LDI.run(sys.argv[1:])
|
61
|
-
|
62
|
-
Arguments:
|
63
|
-
|
64
|
-
* `pgm`, the program name, default to `basename(sys.argv[0])`
|
65
|
-
|
66
|
-
* `doc`, a short description of the command line tool
|
67
|
-
|
68
|
-
* `copyright`, additional doc string that will be appended to the generated
|
69
|
-
doc
|
70
|
-
|
71
|
-
* `version`, version number of string of the tool. If specified, global
|
72
|
-
--version option will be available.
|
73
|
-
|
74
|
-
* `rcfile`, path to a configuration file. If specified, global --C/--rc-file
|
75
|
-
option will be available? self.rcfile = rcfile
|
76
|
-
|
77
|
-
* `logger`, logger to propagate to commands, default to
|
78
|
-
`logging.getLogger(self.pgm))`
|
79
|
-
"""
|
80
|
-
def __init__(self, pgm=None, doc=None, copyright=None, version=None,
|
81
|
-
rcfile=None, logthreshold=logging.ERROR,
|
82
|
-
check_duplicated_command=True):
|
83
|
-
if pgm is None:
|
84
|
-
pgm = basename(sys.argv[0])
|
85
|
-
self.pgm = pgm
|
86
|
-
self.doc = doc
|
87
|
-
self.copyright = copyright
|
88
|
-
self.version = version
|
89
|
-
self.rcfile = rcfile
|
90
|
-
self.logger = None
|
91
|
-
self.logthreshold = logthreshold
|
92
|
-
self.check_duplicated_command = check_duplicated_command
|
93
|
-
|
94
|
-
def register(self, cls, force=False):
|
95
|
-
"""register the given :class:`Command` subclass"""
|
96
|
-
assert not self.check_duplicated_command or force or not cls.name in self, \
|
97
|
-
'a command %s is already defined' % cls.name
|
98
|
-
self[cls.name] = cls
|
99
|
-
return cls
|
100
|
-
|
101
|
-
def run(self, args):
|
102
|
-
"""main command line access point:
|
103
|
-
* init logging
|
104
|
-
* handle global options (-h/--help, --version, -C/--rc-file)
|
105
|
-
* check command
|
106
|
-
* run command
|
107
|
-
|
108
|
-
Terminate by :exc:`SystemExit`
|
109
|
-
"""
|
110
|
-
init_log(debug=True, # so that we use StreamHandler
|
111
|
-
logthreshold=self.logthreshold,
|
112
|
-
logformat='%(levelname)s: %(message)s')
|
113
|
-
try:
|
114
|
-
arg = args.pop(0)
|
115
|
-
except IndexError:
|
116
|
-
self.usage_and_exit(1)
|
117
|
-
if arg in ('-h', '--help'):
|
118
|
-
self.usage_and_exit(0)
|
119
|
-
if self.version is not None and arg in ('--version'):
|
120
|
-
print(self.version)
|
121
|
-
sys.exit(0)
|
122
|
-
rcfile = self.rcfile
|
123
|
-
if rcfile is not None and arg in ('-C', '--rc-file'):
|
124
|
-
try:
|
125
|
-
rcfile = args.pop(0)
|
126
|
-
arg = args.pop(0)
|
127
|
-
except IndexError:
|
128
|
-
self.usage_and_exit(1)
|
129
|
-
try:
|
130
|
-
command = self.get_command(arg)
|
131
|
-
except KeyError:
|
132
|
-
print('ERROR: no %s command' % arg)
|
133
|
-
print()
|
134
|
-
self.usage_and_exit(1)
|
135
|
-
try:
|
136
|
-
sys.exit(command.main_run(args, rcfile))
|
137
|
-
except KeyboardInterrupt as exc:
|
138
|
-
print('Interrupted', end=' ')
|
139
|
-
if str(exc):
|
140
|
-
print(': %s' % exc, end=' ')
|
141
|
-
print()
|
142
|
-
sys.exit(4)
|
143
|
-
except BadCommandUsage as err:
|
144
|
-
print('ERROR:', err)
|
145
|
-
print()
|
146
|
-
print(command.help())
|
147
|
-
sys.exit(1)
|
148
|
-
|
149
|
-
def create_logger(self, handler, logthreshold=None):
|
150
|
-
logger = logging.Logger(self.pgm)
|
151
|
-
logger.handlers = [handler]
|
152
|
-
if logthreshold is None:
|
153
|
-
logthreshold = get_threshold(self.logthreshold)
|
154
|
-
logger.setLevel(logthreshold)
|
155
|
-
return logger
|
156
|
-
|
157
|
-
def get_command(self, cmd, logger=None):
|
158
|
-
if logger is None:
|
159
|
-
logger = self.logger
|
160
|
-
if logger is None:
|
161
|
-
logger = self.logger = logging.getLogger(self.pgm)
|
162
|
-
logger.setLevel(get_threshold(self.logthreshold))
|
163
|
-
return self[cmd](logger)
|
164
|
-
|
165
|
-
def usage(self):
|
166
|
-
"""display usage for the main program (i.e. when no command supplied)
|
167
|
-
and exit
|
168
|
-
"""
|
169
|
-
print('usage:', self.pgm, end=' ')
|
170
|
-
if self.rcfile:
|
171
|
-
print('[--rc-file=<configuration file>]', end=' ')
|
172
|
-
print('<command> [options] <command argument>...')
|
173
|
-
if self.doc:
|
174
|
-
print('\n%s' % self.doc)
|
175
|
-
print('''
|
176
|
-
Type "%(pgm)s <command> --help" for more information about a specific
|
177
|
-
command. Available commands are :\n''' % self.__dict__)
|
178
|
-
max_len = max([len(cmd) for cmd in self])
|
179
|
-
padding = ' ' * max_len
|
180
|
-
for cmdname, cmd in sorted(self.items()):
|
181
|
-
if not cmd.hidden:
|
182
|
-
print(' ', (cmdname + padding)[:max_len], cmd.short_description())
|
183
|
-
if self.rcfile:
|
184
|
-
print('''
|
185
|
-
Use --rc-file=<configuration file> / -C <configuration file> before the command
|
186
|
-
to specify a configuration file. Default to %s.
|
187
|
-
''' % self.rcfile)
|
188
|
-
print('''%(pgm)s -h/--help
|
189
|
-
display this usage information and exit''' % self.__dict__)
|
190
|
-
if self.version:
|
191
|
-
print('''%(pgm)s -v/--version
|
192
|
-
display version configuration and exit''' % self.__dict__)
|
193
|
-
if self.copyright:
|
194
|
-
print('\n', self.copyright)
|
195
|
-
|
196
|
-
def usage_and_exit(self, status):
|
197
|
-
self.usage()
|
198
|
-
sys.exit(status)
|
199
|
-
|
200
|
-
|
201
|
-
# base command classes #########################################################
|
202
|
-
|
203
|
-
class Command(Configuration):
|
204
|
-
"""Base class for command line commands.
|
205
|
-
|
206
|
-
Class attributes:
|
207
|
-
|
208
|
-
* `name`, the name of the command
|
209
|
-
|
210
|
-
* `min_args`, minimum number of arguments, None if unspecified
|
211
|
-
|
212
|
-
* `max_args`, maximum number of arguments, None if unspecified
|
213
|
-
|
214
|
-
* `arguments`, string describing arguments, used in command usage
|
215
|
-
|
216
|
-
* `hidden`, boolean flag telling if the command should be hidden, e.g. does
|
217
|
-
not appear in help's commands list
|
218
|
-
|
219
|
-
* `options`, options list, as allowed by :mod:configuration
|
220
|
-
"""
|
221
|
-
|
222
|
-
arguments = ''
|
223
|
-
name = ''
|
224
|
-
# hidden from help ?
|
225
|
-
hidden = False
|
226
|
-
# max/min args, None meaning unspecified
|
227
|
-
min_args = None
|
228
|
-
max_args = None
|
229
|
-
|
230
|
-
@classmethod
|
231
|
-
def description(cls):
|
232
|
-
return cls.__doc__.replace(' ', '')
|
233
|
-
|
234
|
-
@classmethod
|
235
|
-
def short_description(cls):
|
236
|
-
return cls.description().split('.')[0]
|
237
|
-
|
238
|
-
def __init__(self, logger):
|
239
|
-
usage = '%%prog %s %s\n\n%s' % (self.name, self.arguments,
|
240
|
-
self.description())
|
241
|
-
Configuration.__init__(self, usage=usage)
|
242
|
-
self.logger = logger
|
243
|
-
|
244
|
-
def check_args(self, args):
|
245
|
-
"""check command's arguments are provided"""
|
246
|
-
if self.min_args is not None and len(args) < self.min_args:
|
247
|
-
raise BadCommandUsage('missing argument')
|
248
|
-
if self.max_args is not None and len(args) > self.max_args:
|
249
|
-
raise BadCommandUsage('too many arguments')
|
250
|
-
|
251
|
-
def main_run(self, args, rcfile=None):
|
252
|
-
"""Run the command and return status 0 if everything went fine.
|
253
|
-
|
254
|
-
If :exc:`CommandError` is raised by the underlying command, simply log
|
255
|
-
the error and return status 2.
|
256
|
-
|
257
|
-
Any other exceptions, including :exc:`BadCommandUsage` will be
|
258
|
-
propagated.
|
259
|
-
"""
|
260
|
-
if rcfile:
|
261
|
-
self.load_file_configuration(rcfile)
|
262
|
-
args = self.load_command_line_configuration(args)
|
263
|
-
try:
|
264
|
-
self.check_args(args)
|
265
|
-
self.run(args)
|
266
|
-
except CommandError as err:
|
267
|
-
self.logger.error(err)
|
268
|
-
return 2
|
269
|
-
return 0
|
270
|
-
|
271
|
-
def run(self, args):
|
272
|
-
"""run the command with its specific arguments"""
|
273
|
-
raise NotImplementedError()
|
274
|
-
|
275
|
-
|
276
|
-
class ListCommandsCommand(Command):
|
277
|
-
"""list available commands, useful for bash completion."""
|
278
|
-
name = 'listcommands'
|
279
|
-
arguments = '[command]'
|
280
|
-
hidden = True
|
281
|
-
|
282
|
-
def run(self, args):
|
283
|
-
"""run the command with its specific arguments"""
|
284
|
-
if args:
|
285
|
-
command = args.pop()
|
286
|
-
cmd = _COMMANDS[command]
|
287
|
-
for optname, optdict in cmd.options:
|
288
|
-
print('--help')
|
289
|
-
print('--' + optname)
|
290
|
-
else:
|
291
|
-
commands = sorted(_COMMANDS.keys())
|
292
|
-
for command in commands:
|
293
|
-
cmd = _COMMANDS[command]
|
294
|
-
if not cmd.hidden:
|
295
|
-
print(command)
|
296
|
-
|
297
|
-
|
298
|
-
# deprecated stuff #############################################################
|
299
|
-
|
300
|
-
_COMMANDS = CommandLine()
|
301
|
-
|
302
|
-
DEFAULT_COPYRIGHT = '''\
|
303
|
-
Copyright (c) 2004-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
304
|
-
http://www.logilab.fr/ -- mailto:contact@logilab.fr'''
|
305
|
-
|
306
|
-
@deprecated('use cls.register(cli)')
|
307
|
-
def register_commands(commands):
|
308
|
-
"""register existing commands"""
|
309
|
-
for command_klass in commands:
|
310
|
-
_COMMANDS.register(command_klass)
|
311
|
-
|
312
|
-
@deprecated('use args.pop(0)')
|
313
|
-
def main_run(args, doc=None, copyright=None, version=None):
|
314
|
-
"""command line tool: run command specified by argument list (without the
|
315
|
-
program name). Raise SystemExit with status 0 if everything went fine.
|
316
|
-
|
317
|
-
>>> main_run(sys.argv[1:])
|
318
|
-
"""
|
319
|
-
_COMMANDS.doc = doc
|
320
|
-
_COMMANDS.copyright = copyright
|
321
|
-
_COMMANDS.version = version
|
322
|
-
_COMMANDS.run(args)
|
323
|
-
|
324
|
-
@deprecated('use args.pop(0)')
|
325
|
-
def pop_arg(args_list, expected_size_after=None, msg="Missing argument"):
|
326
|
-
"""helper function to get and check command line arguments"""
|
327
|
-
try:
|
328
|
-
value = args_list.pop(0)
|
329
|
-
except IndexError:
|
330
|
-
raise BadCommandUsage(msg)
|
331
|
-
if expected_size_after is not None and len(args_list) > expected_size_after:
|
332
|
-
raise BadCommandUsage('too many arguments')
|
333
|
-
return value
|
334
|
-
|