mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Copy Python extractor to codeql repo
This commit is contained in:
3
python/extractor/data/python/stubs/README.md
Normal file
3
python/extractor/data/python/stubs/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
This folder contains stubs for commonly used Python libraries, which have
|
||||
the same interface as the original libraries, but are more amenable to
|
||||
static analysis. The original licenses are noted in each subdirectory.
|
||||
18
python/extractor/data/python/stubs/six/LICENSE
Normal file
18
python/extractor/data/python/stubs/six/LICENSE
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright (c) 2010-2019 Benjamin Peterson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
240
python/extractor/data/python/stubs/six/__init__.py
Normal file
240
python/extractor/data/python/stubs/six/__init__.py
Normal file
@@ -0,0 +1,240 @@
|
||||
# Stub file for six.
|
||||
#This should have the same interface as the six module,
|
||||
#but be much more tractable for static analysis.
|
||||
|
||||
|
||||
|
||||
"""Utilities for writing code that runs on Python 2 and 3"""
|
||||
|
||||
# Copyright (c) 2015 Semmle Limited
|
||||
# All rights reserved
|
||||
# Note that the original six module is copyright Benjamin Peterson
|
||||
#
|
||||
|
||||
import operator
|
||||
import sys
|
||||
import types
|
||||
|
||||
__author__ = "Benjamin Peterson <benjamin@python.org>"
|
||||
__version__ = "1.14.0"
|
||||
|
||||
|
||||
# Useful for very coarse version differentiation.
|
||||
PY2 = sys.version_info < (3,)
|
||||
PY3 = sys.version_info >= (3,)
|
||||
|
||||
if PY3:
|
||||
string_types = str,
|
||||
integer_types = int,
|
||||
class_types = type,
|
||||
text_type = str
|
||||
binary_type = bytes
|
||||
|
||||
MAXSIZE = sys.maxsize
|
||||
else:
|
||||
string_types = basestring,
|
||||
integer_types = (int, long)
|
||||
class_types = (type, types.ClassType)
|
||||
text_type = unicode
|
||||
binary_type = str
|
||||
#We can't compute MAXSIZE, but it doesn't really matter
|
||||
MAXSIZE = int((1 << 63) - 1)
|
||||
|
||||
|
||||
def _add_doc(func, doc):
|
||||
"""Add documentation to a function."""
|
||||
func.__doc__ = doc
|
||||
|
||||
|
||||
def _import_module(name):
|
||||
"""Import module, returning the module after the last dot."""
|
||||
__import__(name)
|
||||
return sys.modules[name]
|
||||
|
||||
import six.moves as moves
|
||||
|
||||
|
||||
def add_move(move):
|
||||
"""Add an item to six.moves."""
|
||||
setattr(_MovedItems, move.name, move)
|
||||
|
||||
|
||||
def remove_move(name):
|
||||
"""Remove item from six.moves."""
|
||||
try:
|
||||
delattr(_MovedItems, name)
|
||||
except AttributeError:
|
||||
try:
|
||||
del moves.__dict__[name]
|
||||
except KeyError:
|
||||
raise AttributeError("no such move, %r" % (name,))
|
||||
|
||||
|
||||
if PY3:
|
||||
_meth_func = "__func__"
|
||||
_meth_self = "__self__"
|
||||
|
||||
_func_closure = "__closure__"
|
||||
_func_code = "__code__"
|
||||
_func_defaults = "__defaults__"
|
||||
_func_globals = "__globals__"
|
||||
|
||||
_iterkeys = "keys"
|
||||
_itervalues = "values"
|
||||
_iteritems = "items"
|
||||
_iterlists = "lists"
|
||||
else:
|
||||
_meth_func = "im_func"
|
||||
_meth_self = "im_self"
|
||||
|
||||
_func_closure = "func_closure"
|
||||
_func_code = "func_code"
|
||||
_func_defaults = "func_defaults"
|
||||
_func_globals = "func_globals"
|
||||
|
||||
_iterkeys = "iterkeys"
|
||||
_itervalues = "itervalues"
|
||||
_iteritems = "iteritems"
|
||||
_iterlists = "iterlists"
|
||||
|
||||
|
||||
try:
|
||||
advance_iterator = next
|
||||
except NameError:
|
||||
def advance_iterator(it):
|
||||
return it.next()
|
||||
next = advance_iterator
|
||||
|
||||
|
||||
try:
|
||||
callable = callable
|
||||
except NameError:
|
||||
def callable(obj):
|
||||
return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
|
||||
|
||||
|
||||
if PY3:
|
||||
def get_unbound_function(unbound):
|
||||
return unbound
|
||||
|
||||
create_bound_method = types.MethodType
|
||||
|
||||
Iterator = object
|
||||
else:
|
||||
def get_unbound_function(unbound):
|
||||
return unbound.im_func
|
||||
|
||||
def create_bound_method(func, obj):
|
||||
return types.MethodType(func, obj, obj.__class__)
|
||||
|
||||
class Iterator(object):
|
||||
|
||||
def next(self):
|
||||
return type(self).__next__(self)
|
||||
|
||||
callable = callable
|
||||
_add_doc(get_unbound_function,
|
||||
"""Get the function out of a possibly unbound function""")
|
||||
|
||||
|
||||
get_method_function = operator.attrgetter(_meth_func)
|
||||
get_method_self = operator.attrgetter(_meth_self)
|
||||
get_function_closure = operator.attrgetter(_func_closure)
|
||||
get_function_code = operator.attrgetter(_func_code)
|
||||
get_function_defaults = operator.attrgetter(_func_defaults)
|
||||
get_function_globals = operator.attrgetter(_func_globals)
|
||||
|
||||
|
||||
def iterkeys(d, **kw):
|
||||
"""Return an iterator over the keys of a dictionary."""
|
||||
return iter(getattr(d, _iterkeys)(**kw))
|
||||
|
||||
def itervalues(d, **kw):
|
||||
"""Return an iterator over the values of a dictionary."""
|
||||
return iter(getattr(d, _itervalues)(**kw))
|
||||
|
||||
def iteritems(d, **kw):
|
||||
"""Return an iterator over the (key, value) pairs of a dictionary."""
|
||||
return iter(getattr(d, _iteritems)(**kw))
|
||||
|
||||
def iterlists(d, **kw):
|
||||
"""Return an iterator over the (key, [values]) pairs of a dictionary."""
|
||||
return iter(getattr(d, _iterlists)(**kw))
|
||||
|
||||
def byte2int(ch): #type bytes -> int
|
||||
return int(unknown())
|
||||
|
||||
def b(s): #type str -> bytes
|
||||
"""Byte literal"""
|
||||
return bytes(unknown())
|
||||
|
||||
def u(s): #type str -> unicode
|
||||
"""Text literal"""
|
||||
if PY3:
|
||||
unicode = str
|
||||
return unicode(unknown())
|
||||
|
||||
if PY3:
|
||||
unichr = chr
|
||||
def int2byte(i): #type int -> bytes
|
||||
return bytes(unknown())
|
||||
indexbytes = operator.getitem
|
||||
iterbytes = iter
|
||||
import io
|
||||
StringIO = io.StringIO
|
||||
BytesIO = io.BytesIO
|
||||
else:
|
||||
unichr = unichr
|
||||
int2byte = chr
|
||||
def indexbytes(buf, i):
|
||||
return int(unknown())
|
||||
def iterbytes(buf):
|
||||
return (int(unknown()) for byte in buf)
|
||||
import StringIO
|
||||
StringIO = BytesIO = StringIO.StringIO
|
||||
|
||||
|
||||
if PY3:
|
||||
exec_ = getattr(six.moves.builtins, "exec")
|
||||
|
||||
def reraise(tp, value, tb=None):
|
||||
"""Reraise an exception."""
|
||||
if value.__traceback__ is not tb:
|
||||
raise value.with_traceback(tb)
|
||||
raise value
|
||||
|
||||
else:
|
||||
def exec_(_code_, _globs_=None, _locs_=None):
|
||||
pass
|
||||
|
||||
def reraise(tp, value, tb=None):
|
||||
"""Reraise an exception."""
|
||||
exc = tp(value)
|
||||
exc.__traceback__ = tb
|
||||
raise exc
|
||||
|
||||
|
||||
print_ = getattr(moves.builtins, "print", None)
|
||||
if print_ is None:
|
||||
def print_(*args, **kwargs):
|
||||
"""The new-style print function for Python 2.4 and 2.5."""
|
||||
pass
|
||||
|
||||
def with_metaclass(meta, *bases):
|
||||
"""Create a base class with a metaclass."""
|
||||
return meta("NewBase", bases, {})
|
||||
|
||||
def add_metaclass(metaclass):
|
||||
"""Class decorator for creating a class with a metaclass."""
|
||||
def wrapper(cls):
|
||||
orig_vars = cls.__dict__.copy()
|
||||
orig_vars.pop('__dict__', None)
|
||||
orig_vars.pop('__weakref__', None)
|
||||
slots = orig_vars.get('__slots__')
|
||||
if slots is not None:
|
||||
if isinstance(slots, str):
|
||||
slots = [slots]
|
||||
for slots_var in slots:
|
||||
orig_vars.pop(slots_var)
|
||||
return metaclass(cls.__name__, cls.__bases__, orig_vars)
|
||||
return wrapper
|
||||
239
python/extractor/data/python/stubs/six/moves/__init__.py
Normal file
239
python/extractor/data/python/stubs/six/moves/__init__.py
Normal file
@@ -0,0 +1,239 @@
|
||||
# six.moves
|
||||
|
||||
import sys
|
||||
PY2 = sys.version_info < (3,)
|
||||
PY3 = sys.version_info >= (3,)
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import cStringIO as _1
|
||||
cStringIO = _1.StringIO
|
||||
import itertools as _2
|
||||
filter = _2.filter
|
||||
filterfalse = _2.filterfalse
|
||||
import __builtin__ as _3
|
||||
input = _3.raw_input
|
||||
intern = _3.intern
|
||||
map = _2.map
|
||||
import os as _4
|
||||
getcwd = _4.getcwdu
|
||||
getcwdb = _4.getcwd
|
||||
import commands as _5
|
||||
getoutput = _5.getoutput
|
||||
range = _3.xrange
|
||||
reload_module = _3.reload
|
||||
reduce = _3.reduce
|
||||
import pipes as _6
|
||||
shlex_quote = _6.quote
|
||||
import StringIO as _7
|
||||
StringIO = _7.StringIO
|
||||
import UserDict as _8
|
||||
UserDict = _8.UserDict
|
||||
import UserList as _9
|
||||
UserList = _9.UserList
|
||||
import UserString as _10
|
||||
UserString = _10.UserString
|
||||
xrange = _3.xrange
|
||||
zip = zip
|
||||
zip_longest = _2.zip_longest
|
||||
import __builtin__ as builtins
|
||||
import ConfigParser as configparser
|
||||
import collections as collections_abc
|
||||
import copy_reg as copyreg
|
||||
import gdbm as dbm_gnu
|
||||
import dbm as dbm_ndbm
|
||||
import dummy_thread as _dummy_thread
|
||||
import cookielib as http_cookiejar
|
||||
import Cookie as http_cookies
|
||||
import htmlentitydefs as html_entities
|
||||
import HTMLParser as html_parser
|
||||
import httplib as http_client
|
||||
import email.MIMEBase as email_mime_base
|
||||
import email.MIMEImage as email_mime_image
|
||||
import email.MIMEMultipart as email_mime_multipart
|
||||
import email.MIMENonMultipart as email_mime_nonmultipart
|
||||
import email.MIMEText as email_mime_text
|
||||
import BaseHTTPServer as BaseHTTPServer
|
||||
import CGIHTTPServer as CGIHTTPServer
|
||||
import SimpleHTTPServer as SimpleHTTPServer
|
||||
import cPickle as cPickle
|
||||
import Queue as queue
|
||||
import repr as reprlib
|
||||
import SocketServer as socketserver
|
||||
import thread as _thread
|
||||
import Tkinter as tkinter
|
||||
import Dialog as tkinter_dialog
|
||||
import FileDialog as tkinter_filedialog
|
||||
import ScrolledText as tkinter_scrolledtext
|
||||
import SimpleDialog as tkinter_simpledialog
|
||||
import Tix as tkinter_tix
|
||||
import ttk as tkinter_ttk
|
||||
import Tkconstants as tkinter_constants
|
||||
import Tkdnd as tkinter_dnd
|
||||
import tkColorChooser as tkinter_colorchooser
|
||||
import tkCommonDialog as tkinter_commondialog
|
||||
import tkFileDialog as tkinter_tkfiledialog
|
||||
import tkFont as tkinter_font
|
||||
import tkMessageBox as tkinter_messagebox
|
||||
import tkSimpleDialog as tkinter_tksimpledialog
|
||||
import xmlrpclib as xmlrpc_client
|
||||
import SimpleXMLRPCServer as xmlrpc_server
|
||||
del _1
|
||||
del _5
|
||||
del _7
|
||||
del _8
|
||||
del _6
|
||||
del _3
|
||||
del _9
|
||||
del _2
|
||||
del _10
|
||||
del _4
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import io as _1
|
||||
cStringIO = _1.StringIO
|
||||
import builtins as _2
|
||||
filter = _2.filter
|
||||
import itertools as _3
|
||||
filterfalse = _3.filterfalse
|
||||
input = _2.input
|
||||
import sys as _4
|
||||
intern = _4.intern
|
||||
map = _2.map
|
||||
import os as _5
|
||||
getcwd = _5.getcwd
|
||||
getcwdb = _5.getcwdb
|
||||
import subprocess as _6
|
||||
getoutput = _6.getoutput
|
||||
range = _2.range
|
||||
import importlib as _7
|
||||
reload_module = _7.reload
|
||||
import functools as _8
|
||||
reduce = _8.reduce
|
||||
import shlex as _9
|
||||
shlex_quote = _9.quote
|
||||
StringIO = _1.StringIO
|
||||
import collections as _10
|
||||
UserDict = _10.UserDict
|
||||
UserList = _10.UserList
|
||||
UserString = _10.UserString
|
||||
xrange = _2.range
|
||||
zip = _2.zip
|
||||
zip_longest = _3.zip_longest
|
||||
import builtins as builtins
|
||||
import configparser as configparser
|
||||
import collections.abc as collections_abc
|
||||
import copyreg as copyreg
|
||||
import dbm.gnu as dbm_gnu
|
||||
import dbm.ndbm as dbm_ndbm
|
||||
import _dummy_thread as _dummy_thread
|
||||
import http.cookiejar as http_cookiejar
|
||||
import http.cookies as http_cookies
|
||||
import html.entities as html_entities
|
||||
import html.parser as html_parser
|
||||
import http.client as http_client
|
||||
import email.mime.base as email_mime_base
|
||||
import email.mime.image as email_mime_image
|
||||
import email.mime.multipart as email_mime_multipart
|
||||
import email.mime.nonmultipart as email_mime_nonmultipart
|
||||
import email.mime.text as email_mime_text
|
||||
import http.server as BaseHTTPServer
|
||||
import http.server as CGIHTTPServer
|
||||
import http.server as SimpleHTTPServer
|
||||
import pickle as cPickle
|
||||
import queue as queue
|
||||
import reprlib as reprlib
|
||||
import socketserver as socketserver
|
||||
import _thread as _thread
|
||||
import tkinter as tkinter
|
||||
import tkinter.dialog as tkinter_dialog
|
||||
import tkinter.filedialog as tkinter_filedialog
|
||||
import tkinter.scrolledtext as tkinter_scrolledtext
|
||||
import tkinter.simpledialog as tkinter_simpledialog
|
||||
import tkinter.tix as tkinter_tix
|
||||
import tkinter.ttk as tkinter_ttk
|
||||
import tkinter.constants as tkinter_constants
|
||||
import tkinter.dnd as tkinter_dnd
|
||||
import tkinter.colorchooser as tkinter_colorchooser
|
||||
import tkinter.commondialog as tkinter_commondialog
|
||||
import tkinter.filedialog as tkinter_tkfiledialog
|
||||
import tkinter.font as tkinter_font
|
||||
import tkinter.messagebox as tkinter_messagebox
|
||||
import tkinter.simpledialog as tkinter_tksimpledialog
|
||||
import xmlrpc.client as xmlrpc_client
|
||||
import xmlrpc.server as xmlrpc_server
|
||||
del _1
|
||||
del _2
|
||||
del _3
|
||||
del _4
|
||||
del _5
|
||||
del _6
|
||||
del _7
|
||||
del _8
|
||||
del _9
|
||||
del _10
|
||||
|
||||
# Not generated:
|
||||
|
||||
import six.moves.urllib as urllib
|
||||
import six.moves.urllib_parse as urllib_parse
|
||||
import six.moves.urllib_response as urllib_response
|
||||
import six.moves.urllib_request as urllib_request
|
||||
import six.moves.urllib_error as urllib_error
|
||||
import six.moves.urllib_robotparser as urllib_robotparser
|
||||
|
||||
|
||||
sys.modules['six.moves.builtins'] = builtins
|
||||
sys.modules['six.moves.configparser'] = configparser
|
||||
sys.modules['six.moves.collections_abc'] = collections_abc
|
||||
sys.modules['six.moves.copyreg'] = copyreg
|
||||
sys.modules['six.moves.dbm_gnu'] = dbm_gnu
|
||||
sys.modules['six.moves.dbm_ndbm'] = dbm_ndbm
|
||||
sys.modules['six.moves._dummy_thread'] = _dummy_thread
|
||||
sys.modules['six.moves.http_cookiejar'] = http_cookiejar
|
||||
sys.modules['six.moves.http_cookies'] = http_cookies
|
||||
sys.modules['six.moves.html_entities'] = html_entities
|
||||
sys.modules['six.moves.html_parser'] = html_parser
|
||||
sys.modules['six.moves.http_client'] = http_client
|
||||
sys.modules['six.moves.email_mime_base'] = email_mime_base
|
||||
sys.modules['six.moves.email_mime_image'] = email_mime_image
|
||||
sys.modules['six.moves.email_mime_multipart'] = email_mime_multipart
|
||||
sys.modules['six.moves.email_mime_nonmultipart'] = email_mime_nonmultipart
|
||||
sys.modules['six.moves.email_mime_text'] = email_mime_text
|
||||
sys.modules['six.moves.BaseHTTPServer'] = BaseHTTPServer
|
||||
sys.modules['six.moves.CGIHTTPServer'] = CGIHTTPServer
|
||||
sys.modules['six.moves.SimpleHTTPServer'] = SimpleHTTPServer
|
||||
sys.modules['six.moves.cPickle'] = cPickle
|
||||
sys.modules['six.moves.queue'] = queue
|
||||
sys.modules['six.moves.reprlib'] = reprlib
|
||||
sys.modules['six.moves.socketserver'] = socketserver
|
||||
sys.modules['six.moves._thread'] = _thread
|
||||
sys.modules['six.moves.tkinter'] = tkinter
|
||||
sys.modules['six.moves.tkinter_dialog'] = tkinter_dialog
|
||||
sys.modules['six.moves.tkinter_filedialog'] = tkinter_filedialog
|
||||
sys.modules['six.moves.tkinter_scrolledtext'] = tkinter_scrolledtext
|
||||
sys.modules['six.moves.tkinter_simpledialog'] = tkinter_simpledialog
|
||||
sys.modules['six.moves.tkinter_tix'] = tkinter_tix
|
||||
sys.modules['six.moves.tkinter_ttk'] = tkinter_ttk
|
||||
sys.modules['six.moves.tkinter_constants'] = tkinter_constants
|
||||
sys.modules['six.moves.tkinter_dnd'] = tkinter_dnd
|
||||
sys.modules['six.moves.tkinter_colorchooser'] = tkinter_colorchooser
|
||||
sys.modules['six.moves.tkinter_commondialog'] = tkinter_commondialog
|
||||
sys.modules['six.moves.tkinter_tkfiledialog'] = tkinter_tkfiledialog
|
||||
sys.modules['six.moves.tkinter_font'] = tkinter_font
|
||||
sys.modules['six.moves.tkinter_messagebox'] = tkinter_messagebox
|
||||
sys.modules['six.moves.tkinter_tksimpledialog'] = tkinter_tksimpledialog
|
||||
sys.modules['six.moves.xmlrpc_client'] = xmlrpc_client
|
||||
sys.modules['six.moves.xmlrpc_server'] = xmlrpc_server
|
||||
|
||||
# Windows special
|
||||
|
||||
if PY2:
|
||||
import _winreg as winreg
|
||||
if PY3:
|
||||
import winreg as winreg
|
||||
|
||||
sys.modules['six.moves.winreg'] = winreg
|
||||
|
||||
del sys
|
||||
@@ -0,0 +1,15 @@
|
||||
import sys
|
||||
|
||||
import six.moves.urllib_error as error
|
||||
import six.moves.urllib_parse as parse
|
||||
import six.moves.urllib_request as request
|
||||
import six.moves.urllib_response as response
|
||||
import six.moves.urllib_robotparser as robotparser
|
||||
|
||||
sys.modules['six.moves.urllib.error'] = error
|
||||
sys.modules['six.moves.urllib.parse'] = parse
|
||||
sys.modules['six.moves.urllib.request'] = request
|
||||
sys.modules['six.moves.urllib.response'] = response
|
||||
sys.modules['six.moves.urllib.robotparser'] = robotparser
|
||||
|
||||
del sys
|
||||
21
python/extractor/data/python/stubs/six/moves/urllib_error.py
Normal file
21
python/extractor/data/python/stubs/six/moves/urllib_error.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# six.moves.urllib_error
|
||||
|
||||
from six import PY2, PY3
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import urllib2 as _1
|
||||
URLError = _1.URLError
|
||||
HTTPError = _1.HTTPError
|
||||
import urllib as _2
|
||||
ContentTooShortError = _2.ContentTooShortError
|
||||
del _1
|
||||
del _2
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import urllib.error as _1
|
||||
URLError = _1.URLError
|
||||
HTTPError = _1.HTTPError
|
||||
ContentTooShortError = _1.ContentTooShortError
|
||||
del _1
|
||||
65
python/extractor/data/python/stubs/six/moves/urllib_parse.py
Normal file
65
python/extractor/data/python/stubs/six/moves/urllib_parse.py
Normal file
@@ -0,0 +1,65 @@
|
||||
# six.moves.urllib_parse
|
||||
|
||||
from six import PY2, PY3
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import urlparse as _1
|
||||
ParseResult = _1.ParseResult
|
||||
SplitResult = _1.SplitResult
|
||||
parse_qs = _1.parse_qs
|
||||
parse_qsl = _1.parse_qsl
|
||||
urldefrag = _1.urldefrag
|
||||
urljoin = _1.urljoin
|
||||
urlparse = _1.urlparse
|
||||
urlsplit = _1.urlsplit
|
||||
urlunparse = _1.urlunparse
|
||||
urlunsplit = _1.urlunsplit
|
||||
import urllib as _2
|
||||
quote = _2.quote
|
||||
quote_plus = _2.quote_plus
|
||||
unquote = _2.unquote
|
||||
unquote_plus = _2.unquote_plus
|
||||
unquote_to_bytes = _2.unquote
|
||||
urlencode = _2.urlencode
|
||||
splitquery = _2.splitquery
|
||||
splittag = _2.splittag
|
||||
splituser = _2.splituser
|
||||
splitvalue = _2.splitvalue
|
||||
uses_fragment = _1.uses_fragment
|
||||
uses_netloc = _1.uses_netloc
|
||||
uses_params = _1.uses_params
|
||||
uses_query = _1.uses_query
|
||||
uses_relative = _1.uses_relative
|
||||
del _1
|
||||
del _2
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import urllib.parse as _1
|
||||
ParseResult = _1.ParseResult
|
||||
SplitResult = _1.SplitResult
|
||||
parse_qs = _1.parse_qs
|
||||
parse_qsl = _1.parse_qsl
|
||||
urldefrag = _1.urldefrag
|
||||
urljoin = _1.urljoin
|
||||
urlparse = _1.urlparse
|
||||
urlsplit = _1.urlsplit
|
||||
urlunparse = _1.urlunparse
|
||||
urlunsplit = _1.urlunsplit
|
||||
quote = _1.quote
|
||||
quote_plus = _1.quote_plus
|
||||
unquote = _1.unquote
|
||||
unquote_plus = _1.unquote_plus
|
||||
unquote_to_bytes = _1.unquote_to_bytes
|
||||
urlencode = _1.urlencode
|
||||
splitquery = _1.splitquery
|
||||
splittag = _1.splittag
|
||||
splituser = _1.splituser
|
||||
splitvalue = _1.splitvalue
|
||||
uses_fragment = _1.uses_fragment
|
||||
uses_netloc = _1.uses_netloc
|
||||
uses_params = _1.uses_params
|
||||
uses_query = _1.uses_query
|
||||
uses_relative = _1.uses_relative
|
||||
del _1
|
||||
@@ -0,0 +1,85 @@
|
||||
# six.moves.urllib_request
|
||||
|
||||
from six import PY2, PY3
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import urllib2 as _1
|
||||
urlopen = _1.urlopen
|
||||
install_opener = _1.install_opener
|
||||
build_opener = _1.build_opener
|
||||
import urllib as _2
|
||||
pathname2url = _2.pathname2url
|
||||
url2pathname = _2.url2pathname
|
||||
getproxies = _2.getproxies
|
||||
Request = _1.Request
|
||||
OpenerDirector = _1.OpenerDirector
|
||||
HTTPDefaultErrorHandler = _1.HTTPDefaultErrorHandler
|
||||
HTTPRedirectHandler = _1.HTTPRedirectHandler
|
||||
HTTPCookieProcessor = _1.HTTPCookieProcessor
|
||||
ProxyHandler = _1.ProxyHandler
|
||||
BaseHandler = _1.BaseHandler
|
||||
HTTPPasswordMgr = _1.HTTPPasswordMgr
|
||||
HTTPPasswordMgrWithDefaultRealm = _1.HTTPPasswordMgrWithDefaultRealm
|
||||
AbstractBasicAuthHandler = _1.AbstractBasicAuthHandler
|
||||
HTTPBasicAuthHandler = _1.HTTPBasicAuthHandler
|
||||
ProxyBasicAuthHandler = _1.ProxyBasicAuthHandler
|
||||
AbstractDigestAuthHandler = _1.AbstractDigestAuthHandler
|
||||
HTTPDigestAuthHandler = _1.HTTPDigestAuthHandler
|
||||
ProxyDigestAuthHandler = _1.ProxyDigestAuthHandler
|
||||
HTTPHandler = _1.HTTPHandler
|
||||
HTTPSHandler = _1.HTTPSHandler
|
||||
FileHandler = _1.FileHandler
|
||||
FTPHandler = _1.FTPHandler
|
||||
CacheFTPHandler = _1.CacheFTPHandler
|
||||
UnknownHandler = _1.UnknownHandler
|
||||
HTTPErrorProcessor = _1.HTTPErrorProcessor
|
||||
urlretrieve = _2.urlretrieve
|
||||
urlcleanup = _2.urlcleanup
|
||||
URLopener = _2.URLopener
|
||||
FancyURLopener = _2.FancyURLopener
|
||||
proxy_bypass = _2.proxy_bypass
|
||||
parse_http_list = _1.parse_http_list
|
||||
parse_keqv_list = _1.parse_keqv_list
|
||||
del _1
|
||||
del _2
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import urllib.request as _1
|
||||
urlopen = _1.urlopen
|
||||
install_opener = _1.install_opener
|
||||
build_opener = _1.build_opener
|
||||
pathname2url = _1.pathname2url
|
||||
url2pathname = _1.url2pathname
|
||||
getproxies = _1.getproxies
|
||||
Request = _1.Request
|
||||
OpenerDirector = _1.OpenerDirector
|
||||
HTTPDefaultErrorHandler = _1.HTTPDefaultErrorHandler
|
||||
HTTPRedirectHandler = _1.HTTPRedirectHandler
|
||||
HTTPCookieProcessor = _1.HTTPCookieProcessor
|
||||
ProxyHandler = _1.ProxyHandler
|
||||
BaseHandler = _1.BaseHandler
|
||||
HTTPPasswordMgr = _1.HTTPPasswordMgr
|
||||
HTTPPasswordMgrWithDefaultRealm = _1.HTTPPasswordMgrWithDefaultRealm
|
||||
AbstractBasicAuthHandler = _1.AbstractBasicAuthHandler
|
||||
HTTPBasicAuthHandler = _1.HTTPBasicAuthHandler
|
||||
ProxyBasicAuthHandler = _1.ProxyBasicAuthHandler
|
||||
AbstractDigestAuthHandler = _1.AbstractDigestAuthHandler
|
||||
HTTPDigestAuthHandler = _1.HTTPDigestAuthHandler
|
||||
ProxyDigestAuthHandler = _1.ProxyDigestAuthHandler
|
||||
HTTPHandler = _1.HTTPHandler
|
||||
HTTPSHandler = _1.HTTPSHandler
|
||||
FileHandler = _1.FileHandler
|
||||
FTPHandler = _1.FTPHandler
|
||||
CacheFTPHandler = _1.CacheFTPHandler
|
||||
UnknownHandler = _1.UnknownHandler
|
||||
HTTPErrorProcessor = _1.HTTPErrorProcessor
|
||||
urlretrieve = _1.urlretrieve
|
||||
urlcleanup = _1.urlcleanup
|
||||
URLopener = _1.URLopener
|
||||
FancyURLopener = _1.FancyURLopener
|
||||
proxy_bypass = _1.proxy_bypass
|
||||
parse_http_list = _1.parse_http_list
|
||||
parse_keqv_list = _1.parse_keqv_list
|
||||
del _1
|
||||
@@ -0,0 +1,21 @@
|
||||
# six.moves.urllib_response
|
||||
|
||||
from six import PY2, PY3
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import urllib as _1
|
||||
addbase = _1.addbase
|
||||
addclosehook = _1.addclosehook
|
||||
addinfo = _1.addinfo
|
||||
addinfourl = _1.addinfourl
|
||||
del _1
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import urllib.response as _1
|
||||
addbase = _1.addbase
|
||||
addclosehook = _1.addclosehook
|
||||
addinfo = _1.addinfo
|
||||
addinfourl = _1.addinfourl
|
||||
del _1
|
||||
@@ -0,0 +1,15 @@
|
||||
# six.moves.urllib_robotparser
|
||||
|
||||
from six import PY2, PY3
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 2.7.17 (default, Nov 18 2019, 13:12:39)
|
||||
if PY2:
|
||||
import robotparser as _1
|
||||
RobotFileParser = _1.RobotFileParser
|
||||
del _1
|
||||
|
||||
# Generated (six_gen.py) from six version 1.14.0 with Python 3.8.0 (default, Nov 18 2019, 13:17:17)
|
||||
if PY3:
|
||||
import urllib.robotparser as _1
|
||||
RobotFileParser = _1.RobotFileParser
|
||||
del _1
|
||||
Reference in New Issue
Block a user