On 2/28/24 1:30 PM, Bruno Haible wrote:
> Looks good, except for a typo or spelling mistake. [1]

I'm not the greatest at spelling apparently. Attached it with the typo fixed.

Collin
From c21617ca4561f48225543378d0d4e24ac700877b Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Wed, 28 Feb 2024 13:12:05 -0800
Subject: [PATCH] gnulib-tool.py: Emit year range on file copyright notices.

* pygnulib/GLInfo.py (GLInfo.copyright_range): New function. Return a
copyright string with a year range.
* pygnulib/GLEmiter.py (GLEmiter.copyright_notice): Use the new function
for file copyright headers.
---
 ChangeLog            | 8 ++++++++
 pygnulib/GLEmiter.py | 2 +-
 pygnulib/GLInfo.py   | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8cfe498940..02d22de00f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-02-28  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Emit year range on file copyright notices.
+	* pygnulib/GLInfo.py (GLInfo.copyright_range): New function. Return a
+	copyright string with a year range.
+	* pygnulib/GLEmiter.py (GLEmiter.copyright_notice): Use the new function
+	for file copyright headers.
+
 2024-02-28  Collin Funk  <collin.fu...@gmail.com>
 
 	gnulib-tool.py: Make module sorting more similar to gnulib-tool.
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index d8cc085f59..260478e5da 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -73,7 +73,7 @@ class GLEmiter(object):
         '''GLEmiter.copyright_notice() -> str
 
         Emit a header for a generated file.'''
-        emit = "# %s" % self.info.copyright()
+        emit = '# %s' % self.info.copyright_range()
         emit += """
 #
 # This file is free software; you can redistribute it and/or modify
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index a0a70270a9..08edb9b383 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -125,6 +125,10 @@ class GLInfo(object):
         result = re.compile(' .*').sub('', first_changelog_line)
         return result
 
+    def copyright_range(self):
+        '''Returns a formatted copyright string showing a year range.'''
+        return f'Copyright (C) {constants.__copyright__}'
+
     def usage(self):
         '''Show help message.'''
         result = '''\
-- 
2.39.2

Reply via email to