libv8 6.3.292.48.1 → 6.7.288.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +10 -34
- data/CHANGELOG.md +16 -0
- data/README.md +9 -63
- data/Rakefile +2 -2
- data/ext/libv8/builder.rb +22 -87
- data/ext/libv8/extconf.rb +1 -1
- data/ext/libv8/paths.rb +5 -18
- data/lib/libv8/version.rb +1 -1
- data/spec/location_spec.rb +1 -2
- data/spec/spec_helper.rb +0 -1
- data/vendor/depot_tools/.gitattributes +1 -2
- data/vendor/depot_tools/OWNERS +0 -1
- data/vendor/depot_tools/PRESUBMIT.py +11 -6
- data/vendor/depot_tools/README.md +0 -1
- data/vendor/depot_tools/WATCHLISTS +0 -6
- data/vendor/depot_tools/auth.py +129 -87
- data/vendor/depot_tools/autoninja +11 -1
- data/vendor/depot_tools/autoninja.bat +7 -1
- data/vendor/depot_tools/autoninja.py +14 -6
- 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/cipd +23 -2
- data/vendor/depot_tools/cipd.bat +2 -2
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_manifest.txt +17 -7
- data/vendor/depot_tools/cit.py +7 -6
- data/vendor/depot_tools/cpplint.py +195 -35
- data/vendor/depot_tools/detect_host_arch.py +51 -0
- data/vendor/depot_tools/download_from_google_storage.py +85 -26
- data/vendor/depot_tools/fetch.py +11 -6
- data/vendor/depot_tools/fetch_configs/chromium.py +0 -1
- data/vendor/depot_tools/fetch_configs/goma_client.py +41 -0
- data/vendor/depot_tools/fetch_configs/infra.py +0 -1
- data/vendor/depot_tools/fetch_configs/infra_internal.py +0 -1
- data/vendor/depot_tools/gclient-new-workdir.py +4 -0
- data/vendor/depot_tools/gclient.py +732 -476
- data/vendor/depot_tools/gclient_eval.py +569 -58
- data/vendor/depot_tools/gclient_scm.py +258 -46
- data/vendor/depot_tools/gclient_utils.py +17 -1
- data/vendor/depot_tools/gerrit_util.py +46 -13
- data/vendor/depot_tools/git_cache.py +0 -2
- data/vendor/depot_tools/git_cl.py +176 -335
- data/vendor/depot_tools/git_common.py +19 -16
- data/vendor/depot_tools/git_footers.py +19 -5
- data/vendor/depot_tools/git_hyper_blame.py +9 -3
- data/vendor/depot_tools/git_new_branch.py +15 -3
- data/vendor/depot_tools/git_upstream_diff.py +7 -2
- data/vendor/depot_tools/gsutil.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +1 -2
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/luci-auth +13 -0
- data/vendor/depot_tools/luci-auth.bat +8 -0
- data/vendor/depot_tools/man/html/depot_tools.html +0 -8
- data/vendor/depot_tools/man/html/git-upstream-diff.html +20 -3
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +27 -6
- data/vendor/depot_tools/man/man7/depot_tools.7 +0 -5
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +21 -3
- data/vendor/depot_tools/man/src/make_docs.sh +6 -0
- data/vendor/depot_tools/my_activity.py +283 -93
- data/vendor/depot_tools/owners.py +9 -4
- data/vendor/depot_tools/owners_finder.py +7 -3
- data/vendor/depot_tools/post_build_ninja_summary.py +322 -0
- data/vendor/depot_tools/presubmit_canned_checks.py +91 -106
- data/vendor/depot_tools/presubmit_support.py +219 -157
- data/vendor/depot_tools/prpc +13 -0
- data/vendor/depot_tools/prpc.bat +8 -0
- data/vendor/depot_tools/recipes/OWNERS +3 -1
- data/vendor/depot_tools/recipes/README.recipes.md +70 -111
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +12 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +36 -68
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_json.json → no_apply_patch_on_gclient.json} +64 -10
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{no_shallow.json → shallow.json} +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_empty_revision.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +0 -7
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +44 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_buildbot.json → tryjob_gerrit_branch_heads.json} +51 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +48 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +19 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +193 -155
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +2 -7
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +31 -5
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +37 -19
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +37 -23
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +4 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +40 -8
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +6 -3
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +7 -56
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +0 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +15 -16
- data/vendor/depot_tools/recipes/recipes.py +4 -2
- data/vendor/depot_tools/recipes/trigger_recipe_roller.txt +12 -0
- data/vendor/depot_tools/roll_dep.py +35 -37
- data/vendor/depot_tools/support/chromite_wrapper +1 -1
- data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +3 -3
- data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +2 -2
- data/vendor/depot_tools/third_party/logilab/astroid/astpeephole.py +86 -0
- data/vendor/depot_tools/third_party/logilab/astroid/bases.py +53 -66
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +31 -31
- data/vendor/depot_tools/third_party/logilab/astroid/brain/pynose.py +39 -16
- data/vendor/depot_tools/third_party/logilab/astroid/brain/pysix_moves.py +225 -189
- data/vendor/depot_tools/third_party/logilab/astroid/inference.py +45 -41
- data/vendor/depot_tools/third_party/logilab/astroid/manager.py +1 -0
- data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +2 -2
- data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +3 -2
- data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +1 -0
- data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +57 -3
- data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +1 -1
- data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +21 -1
- data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +58 -33
- data/vendor/depot_tools/third_party/pylint/README.chromium +2 -2
- data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +3 -3
- data/vendor/depot_tools/third_party/pylint/checkers/base.py +6 -18
- data/vendor/depot_tools/third_party/pylint/checkers/classes.py +64 -63
- data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +25 -57
- data/vendor/depot_tools/third_party/pylint/checkers/format.py +14 -10
- data/vendor/depot_tools/third_party/pylint/checkers/python3.py +142 -37
- data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +10 -1
- data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +50 -7
- data/vendor/depot_tools/third_party/pylint/checkers/strings.py +1 -1
- data/vendor/depot_tools/third_party/pylint/epylint.py +2 -1
- data/vendor/depot_tools/third_party/pylint/gui.py +1 -1
- data/vendor/depot_tools/third_party/pylint/lint.py +88 -23
- data/vendor/depot_tools/third_party/pylint/reporters/html.py +37 -5
- data/vendor/depot_tools/third_party/pylint/testutils.py +1 -1
- data/vendor/depot_tools/third_party/pylint/utils.py +5 -0
- data/vendor/depot_tools/vpython +31 -1
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +35 -2
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +0 -15
- data/vendor/depot_tools/yapf +17 -0
- data/vendor/depot_tools/{apply_issue.bat → yapf.bat} +2 -2
- metadata +16 -58
- data/ext/libv8/compiler.rb +0 -39
- data/ext/libv8/compiler/apple_llvm.rb +0 -22
- data/ext/libv8/compiler/clang.rb +0 -22
- data/ext/libv8/compiler/gcc.rb +0 -22
- data/ext/libv8/compiler/generic_compiler.rb +0 -66
- data/ext/libv8/make.rb +0 -13
- data/ext/libv8/patcher.rb +0 -21
- data/patches/0001-Build-a-standalone-static-library.patch +0 -26
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +0 -85
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +0 -25
- data/patches/0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch +0 -25
- data/patches/0005-Remove-TryInstallOptimizedCode.patch +0 -321
- data/patches/mingw-generate-makefiles.sh +0 -97
- data/spec/compiler/apple_llvm_spec.rb +0 -37
- data/spec/compiler/clang_spec.rb +0 -37
- data/spec/compiler/gcc_spec.rb +0 -37
- data/spec/compiler/generic_compiler_spec.rb +0 -50
- data/spec/compiler_spec.rb +0 -45
- data/spec/support/compiler_helpers.rb +0 -47
- data/vendor/depot_tools/apply_issue +0 -8
- data/vendor/depot_tools/apply_issue.py +0 -315
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +0 -815
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +0 -80
- data/vendor/depot_tools/man/src/_git-cherry-pick-upload_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-cherry-pick-upload.demo.1.sh +0 -17
- data/vendor/depot_tools/man/src/git-cherry-pick-upload.txt +0 -35
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_json_win.json +0 -196
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/__init__.py +0 -6
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/api.py +0 -97
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/basic.json +0 -8
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/buildbot.json +0 -30
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/no_auth.json +0 -27
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.py +0 -38
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch.json +0 -69
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch_new.json +0 -69
- data/vendor/depot_tools/third_party/cq_client/OWNERS +0 -2
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +0 -2
- data/vendor/depot_tools/third_party/cq_client/README.md +0 -59
- data/vendor/depot_tools/third_party/cq_client/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v1/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v1/cq.pb.go +0 -810
- data/vendor/depot_tools/third_party/cq_client/v1/cq.proto +0 -281
- data/vendor/depot_tools/third_party/cq_client/v1/cq_pb2.py +0 -794
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_both.cfg +0 -71
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_gerrit.cfg +0 -58
- data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_rietveld.cfg +0 -60
- data/vendor/depot_tools/third_party/cq_client/v2/__init__.py +0 -3
- data/vendor/depot_tools/third_party/cq_client/v2/cq.pb.go +0 -792
- data/vendor/depot_tools/third_party/cq_client/v2/cq.proto +0 -270
- data/vendor/depot_tools/third_party/cq_client/v2/cq_pb2.py +0 -841
@@ -1,31 +1,31 @@
|
|
1
|
-
"""Astroid hooks for pytest."""
|
2
|
-
|
3
|
-
from astroid import MANAGER, register_module_extender
|
4
|
-
from astroid.builder import AstroidBuilder
|
5
|
-
|
6
|
-
|
7
|
-
def pytest_transform():
|
8
|
-
return AstroidBuilder(MANAGER).string_build('''
|
9
|
-
|
10
|
-
try:
|
11
|
-
import _pytest.mark
|
12
|
-
import _pytest.recwarn
|
13
|
-
import _pytest.runner
|
14
|
-
import _pytest.python
|
15
|
-
except ImportError:
|
16
|
-
pass
|
17
|
-
else:
|
18
|
-
deprecated_call = _pytest.recwarn.deprecated_call
|
19
|
-
exit = _pytest.runner.exit
|
20
|
-
fail = _pytest.runner.fail
|
21
|
-
fixture = _pytest.python.fixture
|
22
|
-
importorskip = _pytest.runner.importorskip
|
23
|
-
mark = _pytest.mark.MarkGenerator()
|
24
|
-
raises = _pytest.python.raises
|
25
|
-
skip = _pytest.runner.skip
|
26
|
-
yield_fixture = _pytest.python.yield_fixture
|
27
|
-
|
28
|
-
''')
|
29
|
-
|
30
|
-
register_module_extender(MANAGER, 'pytest', pytest_transform)
|
31
|
-
register_module_extender(MANAGER, 'py.test', pytest_transform)
|
1
|
+
"""Astroid hooks for pytest."""
|
2
|
+
|
3
|
+
from astroid import MANAGER, register_module_extender
|
4
|
+
from astroid.builder import AstroidBuilder
|
5
|
+
|
6
|
+
|
7
|
+
def pytest_transform():
|
8
|
+
return AstroidBuilder(MANAGER).string_build('''
|
9
|
+
|
10
|
+
try:
|
11
|
+
import _pytest.mark
|
12
|
+
import _pytest.recwarn
|
13
|
+
import _pytest.runner
|
14
|
+
import _pytest.python
|
15
|
+
except ImportError:
|
16
|
+
pass
|
17
|
+
else:
|
18
|
+
deprecated_call = _pytest.recwarn.deprecated_call
|
19
|
+
exit = _pytest.runner.exit
|
20
|
+
fail = _pytest.runner.fail
|
21
|
+
fixture = _pytest.python.fixture
|
22
|
+
importorskip = _pytest.runner.importorskip
|
23
|
+
mark = _pytest.mark.MarkGenerator()
|
24
|
+
raises = _pytest.python.raises
|
25
|
+
skip = _pytest.runner.skip
|
26
|
+
yield_fixture = _pytest.python.yield_fixture
|
27
|
+
|
28
|
+
''')
|
29
|
+
|
30
|
+
register_module_extender(MANAGER, 'pytest', pytest_transform)
|
31
|
+
register_module_extender(MANAGER, 'py.test', pytest_transform)
|
@@ -19,38 +19,61 @@
|
|
19
19
|
"""Hooks for nose library."""
|
20
20
|
|
21
21
|
import re
|
22
|
-
import
|
22
|
+
import textwrap
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
import astroid
|
25
|
+
import astroid.builder
|
26
|
+
|
27
|
+
_BUILDER = astroid.builder.AstroidBuilder(astroid.MANAGER)
|
26
28
|
|
27
29
|
|
28
30
|
def _pep8(name, caps=re.compile('([A-Z])')):
|
29
31
|
return caps.sub(lambda m: '_' + m.groups()[0].lower(), name)
|
30
32
|
|
31
33
|
|
32
|
-
def
|
33
|
-
"""
|
34
|
+
def _nose_tools_functions():
|
35
|
+
"""Get an iterator of names and bound methods."""
|
36
|
+
module = _BUILDER.string_build(textwrap.dedent('''
|
37
|
+
import unittest
|
38
|
+
|
39
|
+
class Test(unittest.TestCase):
|
40
|
+
pass
|
41
|
+
a = Test()
|
42
|
+
'''))
|
43
|
+
try:
|
44
|
+
case = next(module['a'].infer())
|
45
|
+
except astroid.InferenceError:
|
46
|
+
return
|
47
|
+
for method in case.methods():
|
48
|
+
if method.name.startswith('assert') and '_' not in method.name:
|
49
|
+
pep8_name = _pep8(method.name)
|
50
|
+
yield pep8_name, astroid.BoundMethod(method, case)
|
51
|
+
|
34
52
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
53
|
+
def _nose_tools_transform(node):
|
54
|
+
for method_name, method in _nose_tools_functions():
|
55
|
+
node.locals[method_name] = [method]
|
56
|
+
|
57
|
+
|
58
|
+
def _nose_tools_trivial_transform():
|
59
|
+
"""Custom transform for the nose.tools module."""
|
60
|
+
stub = _BUILDER.string_build('''__all__ = []''')
|
39
61
|
all_entries = ['ok_', 'eq_']
|
40
62
|
|
41
|
-
for
|
42
|
-
|
43
|
-
|
44
|
-
all_entries.append(pep8_name)
|
45
|
-
stub[pep8_name] = method[0]
|
63
|
+
for pep8_name, method in _nose_tools_functions():
|
64
|
+
all_entries.append(pep8_name)
|
65
|
+
stub[pep8_name] = method
|
46
66
|
|
47
67
|
# Update the __all__ variable, since nose.tools
|
48
68
|
# does this manually with .append.
|
49
69
|
all_assign = stub['__all__'].parent
|
50
|
-
all_object = List(all_entries)
|
70
|
+
all_object = astroid.List(all_entries)
|
51
71
|
all_object.parent = all_assign
|
52
72
|
all_assign.value = all_object
|
53
73
|
return stub
|
54
74
|
|
55
75
|
|
56
|
-
register_module_extender(MANAGER, 'nose.tools.trivial',
|
76
|
+
astroid.register_module_extender(astroid.MANAGER, 'nose.tools.trivial',
|
77
|
+
_nose_tools_trivial_transform)
|
78
|
+
astroid.MANAGER.register_transform(astroid.Module, _nose_tools_transform,
|
79
|
+
lambda n: n.name == 'nose.tools')
|
@@ -23,203 +23,239 @@ from textwrap import dedent
|
|
23
23
|
|
24
24
|
from astroid import MANAGER, register_module_extender
|
25
25
|
from astroid.builder import AstroidBuilder
|
26
|
+
from astroid.exceptions import AstroidBuildingException
|
26
27
|
|
28
|
+
def _indent(text, prefix, predicate=None):
|
29
|
+
"""Adds 'prefix' to the beginning of selected lines in 'text'.
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
If 'predicate' is provided, 'prefix' will only be added to the lines
|
32
|
+
where 'predicate(line)' is True. If 'predicate' is not provided,
|
33
|
+
it will default to adding 'prefix' to all non-empty lines that do not
|
34
|
+
consist solely of whitespace characters.
|
35
|
+
"""
|
36
|
+
if predicate is None:
|
37
|
+
predicate = lambda line: line.strip()
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
from StringIO import StringIO
|
40
|
-
from cStringIO import StringIO as cStringIO
|
41
|
-
from UserDict import UserDict
|
42
|
-
from UserList import UserList
|
43
|
-
from UserString import UserString
|
44
|
-
|
45
|
-
import __builtin__ as builtins
|
46
|
-
import thread as _thread
|
47
|
-
import dummy_thread as _dummy_thread
|
48
|
-
import ConfigParser as configparser
|
49
|
-
import copy_reg as copyreg
|
50
|
-
from itertools import (imap as map,
|
51
|
-
ifilter as filter,
|
52
|
-
ifilterfalse as filterfalse,
|
53
|
-
izip_longest as zip_longest,
|
54
|
-
izip as zip)
|
55
|
-
import htmlentitydefs as html_entities
|
56
|
-
import HTMLParser as html_parser
|
57
|
-
import httplib as http_client
|
58
|
-
import cookielib as http_cookiejar
|
59
|
-
import Cookie as http_cookies
|
60
|
-
import Queue as queue
|
61
|
-
import repr as reprlib
|
62
|
-
from pipes import quote as shlex_quote
|
63
|
-
import SocketServer as socketserver
|
64
|
-
import SimpleXMLRPCServer as xmlrpc_server
|
65
|
-
import xmlrpclib as xmlrpc_client
|
66
|
-
import _winreg as winreg
|
67
|
-
import robotparser as urllib_robotparser
|
68
|
-
|
69
|
-
input = raw_input
|
70
|
-
intern = intern
|
71
|
-
range = xrange
|
72
|
-
xrange = xrange
|
73
|
-
reduce = reduce
|
74
|
-
reload_module = reload
|
75
|
-
|
76
|
-
class UrllibParse(object):
|
77
|
-
ParseResult = _urlparse.ParseResult
|
78
|
-
SplitResult = _urlparse.SplitResult
|
79
|
-
parse_qs = _urlparse.parse_qs
|
80
|
-
parse_qsl = _urlparse.parse_qsl
|
81
|
-
urldefrag = _urlparse.urldefrag
|
82
|
-
urljoin = _urlparse.urljoin
|
83
|
-
urlparse = _urlparse.urlparse
|
84
|
-
urlsplit = _urlparse.urlsplit
|
85
|
-
urlunparse = _urlparse.urlunparse
|
86
|
-
urlunsplit = _urlparse.urlunsplit
|
87
|
-
quote = _urllib.quote
|
88
|
-
quote_plus = _urllib.quote_plus
|
89
|
-
unquote = _urllib.unquote
|
90
|
-
unquote_plus = _urllib.unquote_plus
|
91
|
-
urlencode = _urllib.urlencode
|
92
|
-
splitquery = _urllib.splitquery
|
93
|
-
splittag = _urllib.splittag
|
94
|
-
splituser = _urllib.splituser
|
95
|
-
uses_fragment = _urlparse.uses_fragment
|
96
|
-
uses_netloc = _urlparse.uses_netloc
|
97
|
-
uses_params = _urlparse.uses_params
|
98
|
-
uses_query = _urlparse.uses_query
|
99
|
-
uses_relative = _urlparse.uses_relative
|
100
|
-
|
101
|
-
class UrllibError(object):
|
102
|
-
URLError = _urllib2.URLError
|
103
|
-
HTTPError = _urllib2.HTTPError
|
104
|
-
ContentTooShortError = _urllib.ContentTooShortError
|
105
|
-
|
106
|
-
class DummyModule(object):
|
107
|
-
pass
|
108
|
-
|
109
|
-
class UrllibRequest(object):
|
110
|
-
urlopen = _urllib2.urlopen
|
111
|
-
install_opener = _urllib2.install_opener
|
112
|
-
build_opener = _urllib2.build_opener
|
113
|
-
pathname2url = _urllib.pathname2url
|
114
|
-
url2pathname = _urllib.url2pathname
|
115
|
-
getproxies = _urllib.getproxies
|
116
|
-
Request = _urllib2.Request
|
117
|
-
OpenerDirector = _urllib2.OpenerDirector
|
118
|
-
HTTPDefaultErrorHandler = _urllib2.HTTPDefaultErrorHandler
|
119
|
-
HTTPRedirectHandler = _urllib2.HTTPRedirectHandler
|
120
|
-
HTTPCookieProcessor = _urllib2.HTTPCookieProcessor
|
121
|
-
ProxyHandler = _urllib2.ProxyHandler
|
122
|
-
BaseHandler = _urllib2.BaseHandler
|
123
|
-
HTTPPasswordMgr = _urllib2.HTTPPasswordMgr
|
124
|
-
HTTPPasswordMgrWithDefaultRealm = _urllib2.HTTPPasswordMgrWithDefaultRealm
|
125
|
-
AbstractBasicAuthHandler = _urllib2.AbstractBasicAuthHandler
|
126
|
-
HTTPBasicAuthHandler = _urllib2.HTTPBasicAuthHandler
|
127
|
-
ProxyBasicAuthHandler = _urllib2.ProxyBasicAuthHandler
|
128
|
-
AbstractDigestAuthHandler = _urllib2.AbstractDigestAuthHandler
|
129
|
-
HTTPDigestAuthHandler = _urllib2.HTTPDigestAuthHandler
|
130
|
-
ProxyDigestAuthHandler = _urllib2.ProxyDigestAuthHandler
|
131
|
-
HTTPHandler = _urllib2.HTTPHandler
|
132
|
-
HTTPSHandler = _urllib2.HTTPSHandler
|
133
|
-
FileHandler = _urllib2.FileHandler
|
134
|
-
FTPHandler = _urllib2.FTPHandler
|
135
|
-
CacheFTPHandler = _urllib2.CacheFTPHandler
|
136
|
-
UnknownHandler = _urllib2.UnknownHandler
|
137
|
-
HTTPErrorProcessor = _urllib2.HTTPErrorProcessor
|
138
|
-
urlretrieve = _urllib.urlretrieve
|
139
|
-
urlcleanup = _urllib.urlcleanup
|
140
|
-
proxy_bypass = _urllib.proxy_bypass
|
141
|
-
|
142
|
-
urllib_parse = UrllibParse()
|
143
|
-
urllib_error = UrllibError()
|
144
|
-
urllib = DummyModule()
|
145
|
-
urllib.request = UrllibRequest()
|
146
|
-
urllib.parse = UrllibParse()
|
147
|
-
urllib.error = UrllibError()
|
39
|
+
def prefixed_lines():
|
40
|
+
for line in text.splitlines(True):
|
41
|
+
yield prefix + line if predicate(line) else line
|
42
|
+
return ''.join(prefixed_lines())
|
148
43
|
|
149
|
-
moves = Moves()
|
150
44
|
|
151
|
-
|
45
|
+
if sys.version_info[0] == 2:
|
46
|
+
_IMPORTS_2 = """
|
47
|
+
import BaseHTTPServer
|
48
|
+
import CGIHTTPServer
|
49
|
+
import SimpleHTTPServer
|
152
50
|
|
51
|
+
from StringIO import StringIO
|
52
|
+
from cStringIO import StringIO as cStringIO
|
53
|
+
from UserDict import UserDict
|
54
|
+
from UserList import UserList
|
55
|
+
from UserString import UserString
|
153
56
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
import
|
189
|
-
import
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
import
|
216
|
-
import urllib
|
217
|
-
|
218
|
-
|
57
|
+
import __builtin__ as builtins
|
58
|
+
import thread as _thread
|
59
|
+
import dummy_thread as _dummy_thread
|
60
|
+
import ConfigParser as configparser
|
61
|
+
import copy_reg as copyreg
|
62
|
+
from itertools import (imap as map,
|
63
|
+
ifilter as filter,
|
64
|
+
ifilterfalse as filterfalse,
|
65
|
+
izip_longest as zip_longest,
|
66
|
+
izip as zip)
|
67
|
+
import htmlentitydefs as html_entities
|
68
|
+
import HTMLParser as html_parser
|
69
|
+
import httplib as http_client
|
70
|
+
import cookielib as http_cookiejar
|
71
|
+
import Cookie as http_cookies
|
72
|
+
import Queue as queue
|
73
|
+
import repr as reprlib
|
74
|
+
from pipes import quote as shlex_quote
|
75
|
+
import SocketServer as socketserver
|
76
|
+
import SimpleXMLRPCServer as xmlrpc_server
|
77
|
+
import xmlrpclib as xmlrpc_client
|
78
|
+
import _winreg as winreg
|
79
|
+
import robotparser as urllib_robotparser
|
80
|
+
import Tkinter as tkinter
|
81
|
+
import tkFileDialog as tkinter_tkfiledialog
|
82
|
+
|
83
|
+
input = raw_input
|
84
|
+
intern = intern
|
85
|
+
range = xrange
|
86
|
+
xrange = xrange
|
87
|
+
reduce = reduce
|
88
|
+
reload_module = reload
|
89
|
+
|
90
|
+
class UrllibParse(object):
|
91
|
+
import urlparse as _urlparse
|
92
|
+
import urllib as _urllib
|
93
|
+
ParseResult = _urlparse.ParseResult
|
94
|
+
SplitResult = _urlparse.SplitResult
|
95
|
+
parse_qs = _urlparse.parse_qs
|
96
|
+
parse_qsl = _urlparse.parse_qsl
|
97
|
+
urldefrag = _urlparse.urldefrag
|
98
|
+
urljoin = _urlparse.urljoin
|
99
|
+
urlparse = _urlparse.urlparse
|
100
|
+
urlsplit = _urlparse.urlsplit
|
101
|
+
urlunparse = _urlparse.urlunparse
|
102
|
+
urlunsplit = _urlparse.urlunsplit
|
103
|
+
quote = _urllib.quote
|
104
|
+
quote_plus = _urllib.quote_plus
|
105
|
+
unquote = _urllib.unquote
|
106
|
+
unquote_plus = _urllib.unquote_plus
|
107
|
+
urlencode = _urllib.urlencode
|
108
|
+
splitquery = _urllib.splitquery
|
109
|
+
splittag = _urllib.splittag
|
110
|
+
splituser = _urllib.splituser
|
111
|
+
uses_fragment = _urlparse.uses_fragment
|
112
|
+
uses_netloc = _urlparse.uses_netloc
|
113
|
+
uses_params = _urlparse.uses_params
|
114
|
+
uses_query = _urlparse.uses_query
|
115
|
+
uses_relative = _urlparse.uses_relative
|
116
|
+
|
117
|
+
class UrllibError(object):
|
118
|
+
import urllib2 as _urllib2
|
119
|
+
import urllib as _urllib
|
120
|
+
URLError = _urllib2.URLError
|
121
|
+
HTTPError = _urllib2.HTTPError
|
122
|
+
ContentTooShortError = _urllib.ContentTooShortError
|
123
|
+
|
124
|
+
class DummyModule(object):
|
125
|
+
pass
|
219
126
|
|
127
|
+
class UrllibRequest(object):
|
128
|
+
import urlparse as _urlparse
|
129
|
+
import urllib2 as _urllib2
|
130
|
+
import urllib as _urllib
|
131
|
+
urlopen = _urllib2.urlopen
|
132
|
+
install_opener = _urllib2.install_opener
|
133
|
+
build_opener = _urllib2.build_opener
|
134
|
+
pathname2url = _urllib.pathname2url
|
135
|
+
url2pathname = _urllib.url2pathname
|
136
|
+
getproxies = _urllib.getproxies
|
137
|
+
Request = _urllib2.Request
|
138
|
+
OpenerDirector = _urllib2.OpenerDirector
|
139
|
+
HTTPDefaultErrorHandler = _urllib2.HTTPDefaultErrorHandler
|
140
|
+
HTTPRedirectHandler = _urllib2.HTTPRedirectHandler
|
141
|
+
HTTPCookieProcessor = _urllib2.HTTPCookieProcessor
|
142
|
+
ProxyHandler = _urllib2.ProxyHandler
|
143
|
+
BaseHandler = _urllib2.BaseHandler
|
144
|
+
HTTPPasswordMgr = _urllib2.HTTPPasswordMgr
|
145
|
+
HTTPPasswordMgrWithDefaultRealm = _urllib2.HTTPPasswordMgrWithDefaultRealm
|
146
|
+
AbstractBasicAuthHandler = _urllib2.AbstractBasicAuthHandler
|
147
|
+
HTTPBasicAuthHandler = _urllib2.HTTPBasicAuthHandler
|
148
|
+
ProxyBasicAuthHandler = _urllib2.ProxyBasicAuthHandler
|
149
|
+
AbstractDigestAuthHandler = _urllib2.AbstractDigestAuthHandler
|
150
|
+
HTTPDigestAuthHandler = _urllib2.HTTPDigestAuthHandler
|
151
|
+
ProxyDigestAuthHandler = _urllib2.ProxyDigestAuthHandler
|
152
|
+
HTTPHandler = _urllib2.HTTPHandler
|
153
|
+
HTTPSHandler = _urllib2.HTTPSHandler
|
154
|
+
FileHandler = _urllib2.FileHandler
|
155
|
+
FTPHandler = _urllib2.FTPHandler
|
156
|
+
CacheFTPHandler = _urllib2.CacheFTPHandler
|
157
|
+
UnknownHandler = _urllib2.UnknownHandler
|
158
|
+
HTTPErrorProcessor = _urllib2.HTTPErrorProcessor
|
159
|
+
urlretrieve = _urllib.urlretrieve
|
160
|
+
urlcleanup = _urllib.urlcleanup
|
161
|
+
proxy_bypass = _urllib.proxy_bypass
|
162
|
+
|
163
|
+
urllib_parse = UrllibParse()
|
164
|
+
urllib_error = UrllibError()
|
165
|
+
urllib = DummyModule()
|
166
|
+
urllib.request = UrllibRequest()
|
167
|
+
urllib.parse = UrllibParse()
|
168
|
+
urllib.error = UrllibError()
|
169
|
+
"""
|
170
|
+
else:
|
171
|
+
_IMPORTS_3 = """
|
172
|
+
import _io
|
173
|
+
cStringIO = _io.StringIO
|
174
|
+
filter = filter
|
175
|
+
from itertools import filterfalse
|
176
|
+
input = input
|
177
|
+
from sys import intern
|
178
|
+
map = map
|
179
|
+
range = range
|
180
|
+
from imp import reload as reload_module
|
181
|
+
from functools import reduce
|
182
|
+
from shlex import quote as shlex_quote
|
183
|
+
from io import StringIO
|
184
|
+
from collections import UserDict, UserList, UserString
|
185
|
+
xrange = range
|
186
|
+
zip = zip
|
187
|
+
from itertools import zip_longest
|
188
|
+
import builtins
|
189
|
+
import configparser
|
190
|
+
import copyreg
|
191
|
+
import _dummy_thread
|
192
|
+
import http.cookiejar as http_cookiejar
|
193
|
+
import http.cookies as http_cookies
|
194
|
+
import html.entities as html_entities
|
195
|
+
import html.parser as html_parser
|
196
|
+
import http.client as http_client
|
197
|
+
import http.server
|
198
|
+
BaseHTTPServer = CGIHTTPServer = SimpleHTTPServer = http.server
|
199
|
+
import pickle as cPickle
|
200
|
+
import queue
|
201
|
+
import reprlib
|
202
|
+
import socketserver
|
203
|
+
import _thread
|
204
|
+
import winreg
|
205
|
+
import xmlrpc.server as xmlrpc_server
|
206
|
+
import xmlrpc.client as xmlrpc_client
|
207
|
+
import urllib.robotparser as urllib_robotparser
|
208
|
+
import email.mime.multipart as email_mime_multipart
|
209
|
+
import email.mime.nonmultipart as email_mime_nonmultipart
|
210
|
+
import email.mime.text as email_mime_text
|
211
|
+
import email.mime.base as email_mime_base
|
212
|
+
import urllib.parse as urllib_parse
|
213
|
+
import urllib.error as urllib_error
|
214
|
+
import tkinter
|
215
|
+
import tkinter.dialog as tkinter_dialog
|
216
|
+
import tkinter.filedialog as tkinter_filedialog
|
217
|
+
import tkinter.scrolledtext as tkinter_scrolledtext
|
218
|
+
import tkinter.simpledialog as tkinder_simpledialog
|
219
|
+
import tkinter.tix as tkinter_tix
|
220
|
+
import tkinter.ttk as tkinter_ttk
|
221
|
+
import tkinter.constants as tkinter_constants
|
222
|
+
import tkinter.dnd as tkinter_dnd
|
223
|
+
import tkinter.colorchooser as tkinter_colorchooser
|
224
|
+
import tkinter.commondialog as tkinter_commondialog
|
225
|
+
import tkinter.filedialog as tkinter_tkfiledialog
|
226
|
+
import tkinter.font as tkinter_font
|
227
|
+
import tkinter.messagebox as tkinter_messagebox
|
228
|
+
import urllib.request
|
229
|
+
import urllib.robotparser as urllib_robotparser
|
230
|
+
import urllib.parse as urllib_parse
|
231
|
+
import urllib.error as urllib_error
|
232
|
+
"""
|
220
233
|
if sys.version_info[0] == 2:
|
221
|
-
|
234
|
+
_IMPORTS = dedent(_IMPORTS_2)
|
222
235
|
else:
|
223
|
-
|
236
|
+
_IMPORTS = dedent(_IMPORTS_3)
|
237
|
+
|
238
|
+
|
239
|
+
def six_moves_transform():
|
240
|
+
code = dedent('''
|
241
|
+
class Moves(object):
|
242
|
+
{}
|
243
|
+
moves = Moves()
|
244
|
+
''').format(_indent(_IMPORTS, " "))
|
245
|
+
module = AstroidBuilder(MANAGER).string_build(code)
|
246
|
+
module.name = 'six.moves'
|
247
|
+
return module
|
248
|
+
|
249
|
+
|
250
|
+
def _six_fail_hook(modname):
|
251
|
+
if modname != 'six.moves':
|
252
|
+
raise AstroidBuildingException
|
253
|
+
module = AstroidBuilder(MANAGER).string_build(_IMPORTS)
|
254
|
+
module.name = 'six.moves'
|
255
|
+
return module
|
256
|
+
|
224
257
|
|
225
|
-
register_module_extender(MANAGER, 'six',
|
258
|
+
register_module_extender(MANAGER, 'six', six_moves_transform)
|
259
|
+
register_module_extender(MANAGER, 'requests.packages.urllib3.packages.six',
|
260
|
+
six_moves_transform)
|
261
|
+
MANAGER.register_failed_import_hook(_six_fail_hook)
|