11# This Source Code Form is subject to the terms of the Mozilla Public
22# License, v. 2.0. If a copy of the MPL was not distributed with this
33# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4- from typing import Dict
54from typing import Optional
65
76FORMAT_HTML = "html"
@@ -18,7 +17,7 @@ def extra(
1817 name : Optional [str ] = None ,
1918 mime_type : Optional [str ] = None ,
2019 extension : Optional [str ] = None ,
21- ) -> Dict [str , Optional [str ]]:
20+ ) -> dict [str , Optional [str ]]:
2221 return {
2322 "name" : name ,
2423 "format_type" : format_type ,
@@ -28,7 +27,7 @@ def extra(
2827 }
2928
3029
31- def html (content : str ) -> Dict [str , Optional [str ]]:
30+ def html (content : str ) -> dict [str , Optional [str ]]:
3231 return extra (content , FORMAT_HTML )
3332
3433
@@ -37,31 +36,31 @@ def image(
3736 name : str = "Image" ,
3837 mime_type : str = "image/png" ,
3938 extension : str = "png" ,
40- ) -> Dict [str , Optional [str ]]:
39+ ) -> dict [str , Optional [str ]]:
4140 return extra (content , FORMAT_IMAGE , name , mime_type , extension )
4241
4342
44- def png (content : str , name : str = "Image" ) -> Dict [str , Optional [str ]]:
43+ def png (content : str , name : str = "Image" ) -> dict [str , Optional [str ]]:
4544 return image (content , name , mime_type = "image/png" , extension = "png" )
4645
4746
48- def jpg (content : str , name : str = "Image" ) -> Dict [str , Optional [str ]]:
47+ def jpg (content : str , name : str = "Image" ) -> dict [str , Optional [str ]]:
4948 return image (content , name , mime_type = "image/jpeg" , extension = "jpg" )
5049
5150
52- def svg (content : str , name : str = "Image" ) -> Dict [str , Optional [str ]]:
51+ def svg (content : str , name : str = "Image" ) -> dict [str , Optional [str ]]:
5352 return image (content , name , mime_type = "image/svg+xml" , extension = "svg" )
5453
5554
56- def json (content : str , name : str = "JSON" ) -> Dict [str , Optional [str ]]:
55+ def json (content : str , name : str = "JSON" ) -> dict [str , Optional [str ]]:
5756 return extra (content , FORMAT_JSON , name , "application/json" , "json" )
5857
5958
60- def text (content : str , name : str = "Text" ) -> Dict [str , Optional [str ]]:
59+ def text (content : str , name : str = "Text" ) -> dict [str , Optional [str ]]:
6160 return extra (content , FORMAT_TEXT , name , "text/plain" , "txt" )
6261
6362
64- def url (content : str , name : str = "URL" ) -> Dict [str , Optional [str ]]:
63+ def url (content : str , name : str = "URL" ) -> dict [str , Optional [str ]]:
6564 return extra (content , FORMAT_URL , name )
6665
6766
@@ -70,9 +69,9 @@ def video(
7069 name : str = "Video" ,
7170 mime_type : str = "video/mp4" ,
7271 extension : str = "mp4" ,
73- ) -> Dict [str , Optional [str ]]:
72+ ) -> dict [str , Optional [str ]]:
7473 return extra (content , FORMAT_VIDEO , name , mime_type , extension )
7574
7675
77- def mp4 (content : str , name : str = "Video" ) -> Dict [str , Optional [str ]]:
76+ def mp4 (content : str , name : str = "Video" ) -> dict [str , Optional [str ]]:
7877 return video (content , name )
0 commit comments