mitmproxy.types -> mitmproxy.coretypes

The types name is valuable, and we have a better use for it in collecting and
exposing types for options and commands.

The coretypes module should probably be split up anyway - it contains a
threading base class, a few container objects, and the defintion of our
serialization protocol. I was tempted to rename it to "uncagegorized" for the
sake of honesty.
This commit is contained in:
Aldo Cortesi 2017-12-17 13:31:36 +13:00
parent 1f6656ccb1
commit 978b8d095c
34 changed files with 29 additions and 29 deletions

View File

@ -11,7 +11,7 @@ from pyasn1.codec.der.decoder import decode
from pyasn1.error import PyAsn1Error
import OpenSSL
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
# Default expiry must not be too long: https://github.com/mitmproxy/mitmproxy/issues/815
DEFAULT_EXP = 94608000 # = 24 * 60 * 60 * 365 * 3

View File

@ -1,7 +1,7 @@
import imghdr
from mitmproxy.contentviews import base
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from . import image_parser

View File

@ -1,5 +1,5 @@
from mitmproxy.net import http
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from . import base

View File

@ -1,5 +1,5 @@
from mitmproxy.net.http import url
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from . import base

View File

@ -1,7 +1,7 @@
from abc import ABCMeta, abstractmethod
from collections.abc import MutableMapping
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
class _MultiDict(MutableMapping, metaclass=ABCMeta):

View File

@ -12,7 +12,7 @@ from mitmproxy import http
from mitmproxy import log
from mitmproxy.net import server_spec
from mitmproxy.proxy.protocol import http_replay
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
from . import ctx as mitmproxy_ctx

View File

@ -3,7 +3,7 @@ import re
import time
from typing import Tuple, List, Iterable
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
"""
A flexible module for cookie parsing and manipulation.

View File

@ -1,7 +1,7 @@
import re
import collections
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from mitmproxy.utils import strutils
# See also: http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/

View File

@ -3,7 +3,7 @@ from typing import Optional, Union # noqa
from mitmproxy.utils import strutils
from mitmproxy.net.http import encoding
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
from mitmproxy.net.http import headers

View File

@ -2,7 +2,7 @@ import re
import urllib
from typing import Optional, AnyStr, Dict, Iterable, Tuple, Union
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from mitmproxy.utils import strutils
from mitmproxy.net.http import multipart
from mitmproxy.net.http import cookies

View File

@ -1,7 +1,7 @@
import time
from email.utils import parsedate_tz, formatdate, mktime_tz
from mitmproxy.utils import human
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from mitmproxy.net.http import cookies
from mitmproxy.net.http import headers as nheaders
from mitmproxy.net.http import message

View File

@ -3,7 +3,7 @@ import array
import ipaddress
from mitmproxy.net import check
from mitmproxy.types import bidi
from mitmproxy.coretypes import bidi
class SocksError(Exception):

View File

@ -14,7 +14,7 @@ from OpenSSL import SSL
from mitmproxy import certs
from mitmproxy import exceptions
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
socket_fileobject = socket.SocketIO

View File

@ -6,7 +6,7 @@ from mitmproxy.net import tcp
from mitmproxy.utils import strutils
from mitmproxy.utils import bits
from mitmproxy.utils import human
from mitmproxy.types import bidi
from mitmproxy.coretypes import bidi
from .masker import Masker

View File

@ -15,7 +15,7 @@ from mitmproxy.proxy.protocol import base
from mitmproxy.proxy.protocol import http as httpbase
import mitmproxy.net.http
from mitmproxy.net import tcp
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
from mitmproxy.net.http import http2, headers
from mitmproxy.utils import human

View File

@ -11,7 +11,7 @@ from mitmproxy import options
from mitmproxy import connections
from mitmproxy.net import server_spec
from mitmproxy.net.http import http1
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
from mitmproxy.utils import human

View File

@ -4,7 +4,7 @@ offload computations from mitmproxy's main master thread.
"""
from mitmproxy import eventsequence
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
class ScriptThread(basethread.BaseThread):

View File

@ -2,7 +2,7 @@ from typing import Any
from typing import List
from typing import MutableMapping # noqa
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
def _is_list(cls):

View File

@ -3,7 +3,7 @@ import time
from typing import List
from mitmproxy import flow
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
class TCPMessage(serializable.Serializable):

View File

@ -3,7 +3,7 @@ from typing import List, Optional
from mitmproxy import flow
from mitmproxy.net import websockets
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
from mitmproxy.utils import strutils, human

View File

@ -17,7 +17,7 @@ from mitmproxy.net import tcp, tls
from mitmproxy.net import websockets
from mitmproxy.net import socks
from mitmproxy.net import http as net_http
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
from mitmproxy.utils import strutils
from pathod import log

View File

@ -8,7 +8,7 @@ from mitmproxy.net.http import http2
import mitmproxy.net.http.headers
import mitmproxy.net.http.response
import mitmproxy.net.http.request
from mitmproxy.types import bidi
from mitmproxy.coretypes import bidi
from .. import language

View File

@ -2,7 +2,7 @@ import io
import time
import queue
from . import pathod
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
import typing # noqa

View File

@ -1,6 +1,6 @@
from mitmproxy.contentviews import auto
from mitmproxy.net import http
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from . import full_eval

View File

@ -1,5 +1,5 @@
from mitmproxy.contentviews import query
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
from . import full_eval

View File

@ -1,5 +1,5 @@
import re
from mitmproxy.types import basethread
from mitmproxy.coretypes import basethread
def test_basethread():

View File

@ -1,5 +1,5 @@
import pytest
from mitmproxy.types import bidi
from mitmproxy.coretypes import bidi
def test_bidi():

View File

@ -1,6 +1,6 @@
import pytest
from mitmproxy.types import multidict
from mitmproxy.coretypes import multidict
class _TMulti:

View File

@ -1,6 +1,6 @@
import copy
from mitmproxy.types import serializable
from mitmproxy.coretypes import serializable
class SerializableDummy(serializable.Serializable):