mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
update mypy
This commit is contained in:
parent
dadefaecdb
commit
112233891d
@ -241,7 +241,7 @@ class View(collections.Sequence):
|
||||
self._refilter()
|
||||
self.sig_store_refresh.send(self)
|
||||
|
||||
def add(self, f: mitmproxy.flow.Flow) -> bool:
|
||||
def add(self, f: mitmproxy.flow.Flow) -> None:
|
||||
"""
|
||||
Adds a flow to the state. If the flow already exists, it is
|
||||
ignored.
|
||||
@ -371,6 +371,7 @@ class Focus:
|
||||
def index(self) -> typing.Optional[int]:
|
||||
if self.flow:
|
||||
return self.view.index(self.flow)
|
||||
return None
|
||||
|
||||
@index.setter
|
||||
def index(self, idx):
|
||||
|
@ -36,12 +36,14 @@ def get(name: str) -> Optional[View]:
|
||||
for i in views:
|
||||
if i.name.lower() == name.lower():
|
||||
return i
|
||||
return None
|
||||
|
||||
|
||||
def get_by_shortcut(c: str) -> Optional[View]:
|
||||
for i in views:
|
||||
if i.prompt[1] == c:
|
||||
return i
|
||||
return None
|
||||
|
||||
|
||||
def add(view: View) -> None:
|
||||
|
@ -128,6 +128,7 @@ def is_inline_text(a: Token, b: Token, c: Token) -> bool:
|
||||
if isinstance(a, Tag) and isinstance(b, Text) and isinstance(c, Tag):
|
||||
if a.is_opening and "\n" not in b.data and c.is_closing and a.tag == c.tag:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_inline(prev2: Token, prev1: Token, t: Token, next1: Token, next2: Token) -> bool:
|
||||
@ -140,6 +141,7 @@ def is_inline(prev2: Token, prev1: Token, t: Token, next1: Token, next2: Token)
|
||||
return True # <div></div> (start tag)
|
||||
if isinstance(prev1, Tag) and prev1.is_opening and t.is_closing and prev1.tag == t.tag:
|
||||
return True # <div></div> (end tag)
|
||||
return False
|
||||
|
||||
|
||||
class ElementStack:
|
||||
|
Loading…
Reference in New Issue
Block a user