Re-organize directory structure (#4971)

See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
Ivan Levkivskyi
2021-01-27 12:00:39 +00:00
committed by GitHub
parent 869238e587
commit 16ae4c6120
1399 changed files with 601 additions and 97 deletions

125
stubs/six/six/__init__.pyi Normal file
View File

@@ -0,0 +1,125 @@
from __future__ import print_function
import types
import typing
import unittest
from builtins import next as next
from functools import wraps as wraps
from io import BytesIO as BytesIO, StringIO as StringIO
from typing import (
Any,
AnyStr,
Callable,
Dict,
ItemsView,
Iterable,
KeysView,
Mapping,
NoReturn,
Optional,
Pattern,
Tuple,
Type,
TypeVar,
Union,
ValuesView,
overload,
)
from . import moves as moves
_T = TypeVar("_T")
_K = TypeVar("_K")
_V = TypeVar("_V")
__version__: str
# TODO make constant, then move this stub to 2and3
# https://github.com/python/typeshed/issues/17
PY2 = False
PY3 = True
PY34: bool
string_types = (str,)
integer_types = (int,)
class_types = (type,)
text_type = str
binary_type = bytes
MAXSIZE: int
def callable(obj: object) -> bool: ...
def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ...
def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ...
def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ...
Iterator = object
def get_method_function(meth: types.MethodType) -> types.FunctionType: ...
def get_method_self(meth: types.MethodType) -> Optional[object]: ...
def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ...
def get_function_code(fun: types.FunctionType) -> types.CodeType: ...
def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ...
def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ...
def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ...
def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ...
def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ...
# def iterlists
def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ...
def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ...
def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ...
def b(s: str) -> binary_type: ...
def u(s: str) -> text_type: ...
unichr = chr
def int2byte(i: int) -> bytes: ...
def byte2int(bs: binary_type) -> int: ...
def indexbytes(buf: binary_type, i: int) -> int: ...
def iterbytes(buf: binary_type) -> typing.Iterator[int]: ...
def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ...
@overload
def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ...
@overload
def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ...
def assertRegex(
self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...
) -> None: ...
exec_ = exec
def reraise(
tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...
) -> NoReturn: ...
def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ...
print_ = print
def with_metaclass(meta: type, *bases: type) -> type: ...
def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ...
def ensure_binary(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> bytes: ...
def ensure_str(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> str: ...
def ensure_text(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> str: ...
def python_2_unicode_compatible(klass: _T) -> _T: ...
class _LazyDescriptor:
name: str
def __init__(self, name: str) -> None: ...
def __get__(self, obj: Optional[object], type: Optional[type] = ...) -> Any: ...
class MovedModule(_LazyDescriptor):
mod: str
def __init__(self, name: str, old: str, new: Optional[str] = ...) -> None: ...
def __getattr__(self, attr: str) -> Any: ...
class MovedAttribute(_LazyDescriptor):
mod: str
attr: str
def __init__(
self, name: str, old_mod: str, new_mod: str, old_attr: Optional[str] = ..., new_attr: Optional[str] = ...
) -> None: ...
def add_move(move: Union[MovedModule, MovedAttribute]) -> None: ...
def remove_move(name: str) -> None: ...

View File

@@ -0,0 +1 @@
from http.server import *

View File

@@ -0,0 +1 @@
from http.server import *

View File

@@ -0,0 +1 @@
from http.server import *

View File

@@ -0,0 +1,65 @@
# Stubs for six.moves
#
# Note: Commented out items means they weren't implemented at the time.
# Uncomment them when the modules have been added to the typeshed.
import importlib
import shlex
from builtins import filter as filter, input as input, map as map, range as range, zip as zip
from collections import UserDict as UserDict, UserList as UserList, UserString as UserString
from functools import reduce as reduce
from io import StringIO as StringIO
from itertools import filterfalse as filterfalse, zip_longest as zip_longest
from os import getcwd as getcwd, getcwdb as getcwdb
from sys import intern as intern
# import tkinter.font as tkinter_font
# import tkinter.messagebox as tkinter_messagebox
# import tkinter.simpledialog as tkinter_tksimpledialog
# import tkinter.dnd as tkinter_dnd
# import tkinter.colorchooser as tkinter_colorchooser
# import tkinter.scrolledtext as tkinter_scrolledtext
# import tkinter.simpledialog as tkinter_simpledialog
# import tkinter.tix as tkinter_tix
# import copyreg as copyreg
# import dbm.gnu as dbm_gnu
from . import (
BaseHTTPServer as BaseHTTPServer,
CGIHTTPServer as CGIHTTPServer,
SimpleHTTPServer as SimpleHTTPServer,
_dummy_thread as _dummy_thread,
_thread as _thread,
builtins as builtins,
configparser as configparser,
cPickle as cPickle,
email_mime_base as email_mime_base,
email_mime_multipart as email_mime_multipart,
email_mime_nonmultipart as email_mime_nonmultipart,
email_mime_text as email_mime_text,
html_entities as html_entities,
html_parser as html_parser,
http_client as http_client,
http_cookiejar as http_cookiejar,
http_cookies as http_cookies,
queue as queue,
reprlib as reprlib,
socketserver as socketserver,
tkinter as tkinter,
tkinter_commondialog as tkinter_commondialog,
tkinter_constants as tkinter_constants,
tkinter_dialog as tkinter_dialog,
tkinter_filedialog as tkinter_filedialog,
tkinter_tkfiledialog as tkinter_tkfiledialog,
tkinter_ttk as tkinter_ttk,
urllib as urllib,
urllib_error as urllib_error,
urllib_parse as urllib_parse,
urllib_robotparser as urllib_robotparser,
)
# import xmlrpc.client as xmlrpc_client
# import xmlrpc.server as xmlrpc_server
xrange = range
reload_module = importlib.reload
cStringIO = StringIO
shlex_quote = shlex.quote

View File

@@ -0,0 +1 @@
from _dummy_thread import *

View File

@@ -0,0 +1 @@
from _thread import *

View File

@@ -0,0 +1 @@
from builtins import *

View File

@@ -0,0 +1 @@
from pickle import *

View File

@@ -0,0 +1 @@
from collections.abc import *

View File

@@ -0,0 +1 @@
from configparser import *

View File

@@ -0,0 +1 @@
from email.mime.base import *

View File

@@ -0,0 +1 @@
from email.mime.multipart import *

View File

@@ -0,0 +1 @@
from email.mime.nonmultipart import *

View File

@@ -0,0 +1 @@
from email.mime.text import *

View File

@@ -0,0 +1 @@
from html.entities import *

View File

@@ -0,0 +1 @@
from html.parser import *

View File

@@ -0,0 +1 @@
from http.client import *

View File

@@ -0,0 +1 @@
from http.cookiejar import *

View File

@@ -0,0 +1 @@
from http.cookies import *

View File

@@ -0,0 +1 @@
from queue import *

View File

@@ -0,0 +1 @@
from reprlib import *

View File

@@ -0,0 +1 @@
from socketserver import *

View File

@@ -0,0 +1 @@
from tkinter import *

View File

@@ -0,0 +1 @@
from tkinter.commondialog import *

View File

@@ -0,0 +1 @@
from tkinter.constants import *

View File

@@ -0,0 +1 @@
from tkinter.dialog import *

View File

@@ -0,0 +1 @@
from tkinter.filedialog import *

View File

@@ -0,0 +1 @@
from tkinter.filedialog import *

View File

@@ -0,0 +1 @@
from tkinter.ttk import *

View File

@@ -0,0 +1,5 @@
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

View File

@@ -0,0 +1 @@
from urllib.error import ContentTooShortError as ContentTooShortError, HTTPError as HTTPError, URLError as URLError

View File

@@ -0,0 +1,30 @@
# Stubs for six.moves.urllib.parse
#
# Note: Commented out items means they weren't implemented at the time.
# Uncomment them when the modules have been added to the typeshed.
# from urllib.parse import splitquery as splitquery
# from urllib.parse import splittag as splittag
# from urllib.parse import splituser as splituser
from urllib.parse import (
ParseResult as ParseResult,
SplitResult as SplitResult,
parse_qs as parse_qs,
parse_qsl as parse_qsl,
quote as quote,
quote_plus as quote_plus,
unquote as unquote,
unquote_plus as unquote_plus,
unquote_to_bytes as unquote_to_bytes,
urldefrag as urldefrag,
urlencode as urlencode,
urljoin as urljoin,
urlparse as urlparse,
urlsplit as urlsplit,
urlunparse as urlunparse,
urlunsplit as urlunsplit,
uses_fragment as uses_fragment,
uses_netloc as uses_netloc,
uses_params as uses_params,
uses_query as uses_query,
uses_relative as uses_relative,
)

View File

@@ -0,0 +1,41 @@
# Stubs for six.moves.urllib.request
#
# Note: Commented out items means they weren't implemented at the time.
# Uncomment them when the modules have been added to the typeshed.
# from urllib.request import proxy_bypass as proxy_bypass
from urllib.request import (
AbstractBasicAuthHandler as AbstractBasicAuthHandler,
AbstractDigestAuthHandler as AbstractDigestAuthHandler,
BaseHandler as BaseHandler,
CacheFTPHandler as CacheFTPHandler,
FancyURLopener as FancyURLopener,
FileHandler as FileHandler,
FTPHandler as FTPHandler,
HTTPBasicAuthHandler as HTTPBasicAuthHandler,
HTTPCookieProcessor as HTTPCookieProcessor,
HTTPDefaultErrorHandler as HTTPDefaultErrorHandler,
HTTPDigestAuthHandler as HTTPDigestAuthHandler,
HTTPErrorProcessor as HTTPErrorProcessor,
HTTPHandler as HTTPHandler,
HTTPPasswordMgr as HTTPPasswordMgr,
HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm,
HTTPRedirectHandler as HTTPRedirectHandler,
HTTPSHandler as HTTPSHandler,
OpenerDirector as OpenerDirector,
ProxyBasicAuthHandler as ProxyBasicAuthHandler,
ProxyDigestAuthHandler as ProxyDigestAuthHandler,
ProxyHandler as ProxyHandler,
Request as Request,
UnknownHandler as UnknownHandler,
URLopener as URLopener,
build_opener as build_opener,
getproxies as getproxies,
install_opener as install_opener,
parse_http_list as parse_http_list,
parse_keqv_list as parse_keqv_list,
pathname2url as pathname2url,
url2pathname as url2pathname,
urlcleanup as urlcleanup,
urlopen as urlopen,
urlretrieve as urlretrieve,
)

View File

@@ -0,0 +1,8 @@
# Stubs for six.moves.urllib.response
#
# Note: Commented out items means they weren't implemented at the time.
# Uncomment them when the modules have been added to the typeshed.
# from urllib.response import addbase as addbase
# from urllib.response import addclosehook as addclosehook
# from urllib.response import addinfo as addinfo
from urllib.response import addinfourl as addinfourl

View File

@@ -0,0 +1 @@
from urllib.robotparser import RobotFileParser as RobotFileParser

View File

@@ -0,0 +1 @@
from urllib.error import *

View File

@@ -0,0 +1 @@
from urllib.parse import *

View File

@@ -0,0 +1 @@
from .urllib.request import *

View File

@@ -0,0 +1 @@
from .urllib.response import *

View File

@@ -0,0 +1 @@
from urllib.robotparser import *