[Concept,2/7] patman: Add plural() helper to CseriesHelper
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Add a simple helper method that returns 's' when a value is not 1,
for use in formatting plural strings.
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
tools/patman/cser_helper.py | 7 +++++++
1 file changed, 7 insertions(+)
@@ -304,6 +304,13 @@ class CseriesHelper:
series.idnum = in_series.idnum
series.name = in_series.name
+ def plural(self, val):
+ """Returns a string to make something plural
+
+ So far this is very simple and just returns an 's' when needed
+ """
+ return '' if val == 1 else 's'
+
def _handle_mark(self, branch_name, in_series, version, mark,
allow_unmarked, force_version, dry_run):
"""Handle marking a series, checking for unmarked commits, etc.