]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Emit year range on file copyright notices.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 28 Feb 2024 21:12:05 +0000 (13:12 -0800)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Feb 2024 23:33:54 +0000 (00:33 +0100)
* 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
pygnulib/GLEmiter.py
pygnulib/GLInfo.py

index 8cfe49894051d4def3f68830caf7df4dc9a57fc0..02d22de00f207174007162692e5b6a23193a9bb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-02-28  Collin Funk  <collin.funk1@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.funk1@gmail.com>
 
        gnulib-tool.py: Make module sorting more similar to gnulib-tool.
index d8cc085f59ddef63d975698f12a54ebdb71f6601..260478e5dab513c2b1c73d675693564d50db2de6 100644 (file)
@@ -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
index a0a70270a926718bda381f4e1c58f9825b3e582e..08edb9b38330d659834b24aab2f8f45c1b6b5b4c 100644 (file)
@@ -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 = '''\