Skip to content

Commit f40bba9

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: kdoc_item: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <65a7c6bb318e7a8cbf5c115903d507568099151a.1768838938.git.mchehab+huawei@kernel.org>
1 parent 8d08c7c commit f40bba9

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tools/lib/python/kdoc/kdoc_item.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
# then pass into the output modules.
55
#
66

7+
"""
8+
Data class to store a kernel-doc Item.
9+
"""
10+
711
class KdocItem:
12+
"""
13+
A class that will, eventually, encapsulate all of the parsed data that we
14+
then pass into the output modules.
15+
"""
16+
817
def __init__(self, name, fname, type, start_line, **other_stuff):
918
self.name = name
1019
self.fname = fname
@@ -24,6 +33,9 @@ def __init__(self, name, fname, type, start_line, **other_stuff):
2433
self.other_stuff = other_stuff
2534

2635
def get(self, key, default = None):
36+
"""
37+
Get a value from optional keys.
38+
"""
2739
return self.other_stuff.get(key, default)
2840

2941
def __getitem__(self, key):
@@ -33,10 +45,16 @@ def __getitem__(self, key):
3345
# Tracking of section and parameter information.
3446
#
3547
def set_sections(self, sections, start_lines):
48+
"""
49+
Set sections and start lines.
50+
"""
3651
self.sections = sections
3752
self.section_start_lines = start_lines
3853

3954
def set_params(self, names, descs, types, starts):
55+
"""
56+
Set parameter list: names, descriptions, types and start lines.
57+
"""
4058
self.parameterlist = names
4159
self.parameterdescs = descs
4260
self.parametertypes = types

0 commit comments

Comments
 (0)