mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
mypy: Add Dict parameters for dropbox_image return type.
Also a note re using TypedDict in future, as the Dict looks constrained.
This commit is contained in:
parent
737408f741
commit
b693f32c0b
@ -404,8 +404,8 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
|
||||
return False
|
||||
|
||||
def dropbox_image(self, url):
|
||||
# type: (Text) -> Optional[Dict]
|
||||
# TODO: specify details of returned Dict
|
||||
# type: (Text) -> Optional[Dict[str, Any]]
|
||||
# TODO: The returned Dict could possibly be a TypedDict in future.
|
||||
parsed_url = urllib.parse.urlparse(url)
|
||||
if (parsed_url.netloc == 'dropbox.com' or parsed_url.netloc.endswith('.dropbox.com')):
|
||||
is_album = parsed_url.path.startswith('/sc/') or parsed_url.path.startswith('/photos/')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user