[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <340032ca56db393a2a10dd828bedf5e63c7983ca.1768396023.git.mchehab+huawei@kernel.org>
Date: Wed, 14 Jan 2026 14:17:25 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
linux-kernel@...r.kernel.org,
Jonathan Corbet <corbet@....net>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>
Subject: [PATCH 12/13] 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@...nel.org>
---
tools/lib/python/kdoc/python_version.py | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/tools/lib/python/kdoc/python_version.py b/tools/lib/python/kdoc/python_version.py
index e83088013db2..4ddb7ead5f56 100644
--- a/tools/lib/python/kdoc/python_version.py
+++ b/tools/lib/python/kdoc/python_version.py
@@ -33,21 +33,31 @@ class PythonVersion:
"""
def __init__(self, version):
- """Ïnitialize self.version tuple from a version string"""
+ """
+ Ïnitialize self.version tuple from a version string.
+ """
self.version = self.parse_version(version)
@staticmethod
def parse_version(version):
- """Convert a major.minor.patch version into a tuple"""
+ """
+ Convert a major.minor.patch version into a tuple.
+ """
return tuple(int(x) for x in version.split("."))
@staticmethod
def ver_str(version):
- """Returns a version tuple as major.minor.patch"""
+ """
+ Returns a version tuple as major.minor.patch.
+ """
return ".".join([str(x) for x in version])
@staticmethod
def cmd_print(cmd, max_len=80):
+ """
+ Outputs a command line, repecting maximum width.
+ """
+
cmd_line = []
for w in cmd:
@@ -66,7 +76,9 @@ class PythonVersion:
return "\n ".join(cmd_line)
def __str__(self):
- """Returns a version tuple as major.minor.patch from self.version"""
+ """
+ Return a version tuple as major.minor.patch from self.version.
+ """
return self.ver_str(self.version)
@staticmethod
--
2.52.0
Powered by blists - more mailing lists