Skip to content

Commit

Permalink
imprv: extract class' docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboghazala authored and lovetox committed May 1, 2023
1 parent 5cba419 commit 9afbf64
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import itertools
import pprint
import re
import textwrap
from types import ModuleType

import gi
Expand Down Expand Up @@ -703,6 +704,16 @@ def _gi_build_stub(
else:
ret += f"class {name}{string_parents}:\n"

# extracting docs
doc = getattr(obj, "__doc__", "") or ""
gdoc = getattr(obj, "__gdoc__", "") or ""

txt = doc + "\n" + gdoc
if txt:
txt = '"""' + txt + '"""' + "\n"
txt = textwrap.indent(txt, " ")
ret += txt

props_override = _check_override(full_name, "Props", overrides)
if props_override:
for line in props_override.splitlines():
Expand Down

0 comments on commit 9afbf64

Please sign in to comment.