mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
Add new contentviews' content type mappings
This commit is contained in:
parent
82a90511bc
commit
d7239d665e
@ -520,8 +520,18 @@ def add(obj):
|
||||
if i.name == obj.name:
|
||||
raise ContentViewException("Duplicate view: " + obj.name)
|
||||
|
||||
for prompt in view_prompts:
|
||||
if prompt[1] == obj.prompt[1]:
|
||||
raise ContentViewException("Duplicate view shortcut: " + obj.prompt[1])
|
||||
|
||||
views.append(obj)
|
||||
|
||||
for ct in obj.content_types:
|
||||
l = content_types_map.setdefault(ct, [])
|
||||
l.append(obj)
|
||||
|
||||
view_prompts.append(obj.prompt)
|
||||
|
||||
|
||||
def get(name):
|
||||
for i in views:
|
||||
|
@ -217,6 +217,7 @@ Larry
|
||||
tcv = TestContentView()
|
||||
cv.add(tcv)
|
||||
|
||||
# repeated addition causes exception
|
||||
tutils.raises(
|
||||
ContentViewException,
|
||||
cv.add,
|
||||
|
Loading…
Reference in New Issue
Block a user