diff options
author | harsh vijay <iharsh234@gmail.com> | 2017-05-02 05:19:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 05:19:25 +0530 |
commit | e24b4cc1b64455b8b9b5d1265103054bb8b3a8af (patch) | |
tree | e7e9474787505ffbaa348fbd0235529adb74f0e7 /examples/simple/custom_contentview.py | |
parent | 53ad658e9f59743b72cb234f9b160aa6dc3d1f72 (diff) | |
download | mitmproxy-e24b4cc1b64455b8b9b5d1265103054bb8b3a8af.tar.gz mitmproxy-e24b4cc1b64455b8b9b5d1265103054bb8b3a8af.tar.bz2 mitmproxy-e24b4cc1b64455b8b9b5d1265103054bb8b3a8af.zip |
Extend Mypy checking to pathod
* mypy checking pathod
* initial commit , fixed errors
* tox: mypy checking to pathod
* Fixed mypy test failed
* issue was with args in custom_contentview.py
* tox: mypy checking to #2221
* follow-import=skip since we cant provide args to custom_contentview.py during mypy testing
* Lint , Typo Fixed
* code style: module import
Diffstat (limited to 'examples/simple/custom_contentview.py')
-rw-r--r-- | examples/simple/custom_contentview.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/simple/custom_contentview.py b/examples/simple/custom_contentview.py index 289e1efe..71f92575 100644 --- a/examples/simple/custom_contentview.py +++ b/examples/simple/custom_contentview.py @@ -3,7 +3,10 @@ This example shows how one can add a custom contentview to mitmproxy. The content view API is explained in the mitmproxy.contentviews module. """ from mitmproxy import contentviews -from typing import Tuple, Iterable, AnyStr, List +import typing + + +CVIEWSWAPCASE = typing.Tuple[str, typing.Iterable[typing.List[typing.Tuple[str, typing.AnyStr]]]] class ViewSwapCase(contentviews.View): @@ -14,7 +17,7 @@ class ViewSwapCase(contentviews.View): prompt = ("swap case text", "z") content_types = ["text/plain"] - def __call__(self, data: bytes, **metadata) -> Tuple[str, Iterable[List[Tuple[str, AnyStr]]]]: + def __call__(self, data: typing.AnyStr, **metadata) -> CVIEWSWAPCASE: return "case-swapped text", contentviews.format_text(data.swapcase()) |