mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add Python3 type annotation to cherry-picked #6310 for 2.2.0 release
This commit is contained in:
parent
548d329f35
commit
2d5d290cd4
@ -91,8 +91,7 @@ depthsvg_re = re.compile(br'.*, depth=(.*)pt')
|
||||
depthsvgcomment_re = re.compile(r'<!-- DEPTH=(-?\d+) -->')
|
||||
|
||||
|
||||
def read_svg_depth(filename):
|
||||
# type: (str) -> int
|
||||
def read_svg_depth(filename: str) -> int:
|
||||
"""Read the depth from comment at last line of SVG file
|
||||
"""
|
||||
with open(filename, 'r') as f:
|
||||
@ -105,8 +104,7 @@ def read_svg_depth(filename):
|
||||
return None
|
||||
|
||||
|
||||
def write_svg_depth(filename, depth):
|
||||
# type: (str, int) -> None
|
||||
def write_svg_depth(filename: str, depth:int) -> None:
|
||||
"""Write the depth to SVG file as a comment at end of file
|
||||
"""
|
||||
with open(filename, 'a') as f:
|
||||
|
Loading…
Reference in New Issue
Block a user