mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
PyDoc: avoid blank lines at the beginning of code-examples
This commit is contained in:
parent
276f6840ed
commit
28169cea3d
1 changed files with 8 additions and 1 deletions
|
|
@ -551,7 +551,7 @@ def example_extract_docstring(filepath):
|
|||
file.close()
|
||||
return "", 0
|
||||
|
||||
for line in file.readlines():
|
||||
for line in file:
|
||||
line_no += 1
|
||||
if line.startswith('"""'):
|
||||
break
|
||||
|
|
@ -559,6 +559,13 @@ def example_extract_docstring(filepath):
|
|||
text.append(line.rstrip())
|
||||
|
||||
line_no += 1
|
||||
|
||||
# Skip over blank lines so the Python code doesn't have blank lines at the top.
|
||||
for line in file:
|
||||
if line.strip():
|
||||
break
|
||||
line_no += 1
|
||||
|
||||
file.close()
|
||||
return "\n".join(text), line_no
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue