Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: kdoc: python_version: 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: <2153afaeb496e1bb8d3cc318fff26c3f99d99486.1768838938.git.mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
33220c1f 7ef684c9

+16 -4
+16 -4
tools/lib/python/kdoc/python_version.py
··· 33 33 """ 34 34 35 35 def __init__(self, version): 36 - """Ïnitialize self.version tuple from a version string""" 36 + """ 37 + Ïnitialize self.version tuple from a version string. 38 + """ 37 39 self.version = self.parse_version(version) 38 40 39 41 @staticmethod 40 42 def parse_version(version): 41 - """Convert a major.minor.patch version into a tuple""" 43 + """ 44 + Convert a major.minor.patch version into a tuple. 45 + """ 42 46 return tuple(int(x) for x in version.split(".")) 43 47 44 48 @staticmethod 45 49 def ver_str(version): 46 - """Returns a version tuple as major.minor.patch""" 50 + """ 51 + Returns a version tuple as major.minor.patch. 52 + """ 47 53 return ".".join([str(x) for x in version]) 48 54 49 55 @staticmethod 50 56 def cmd_print(cmd, max_len=80): 57 + """ 58 + Outputs a command line, repecting maximum width. 59 + """ 60 + 51 61 cmd_line = [] 52 62 53 63 for w in cmd: ··· 76 66 return "\n ".join(cmd_line) 77 67 78 68 def __str__(self): 79 - """Returns a version tuple as major.minor.patch from self.version""" 69 + """ 70 + Return a version tuple as major.minor.patch from self.version. 71 + """ 80 72 return self.ver_str(self.version) 81 73 82 74 @staticmethod