gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz ./Makefile metacode/copyrighter.py


From: Benja Fallenstein
Subject: [Gzz-commits] gzz ./Makefile metacode/copyrighter.py
Date: Fri, 28 Feb 2003 08:51:57 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      03/02/28 08:51:57

Modified files:
        .              : Makefile 
        metacode       : copyrighter.py 

Log message:
        Make copyrighter usable with projects other than Gzz

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.247&tr2=1.248&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/copyrighter.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: gzz/Makefile
diff -u gzz/Makefile:1.247 gzz/Makefile:1.248
--- gzz/Makefile:1.247  Wed Feb 26 11:03:42 2003
+++ gzz/Makefile        Fri Feb 28 08:51:56 2003
@@ -85,7 +85,7 @@
 .PHONY : ChangeLog Manifest dist official-release
 
 copyrighted:
-       python metacode/copyrighter.py
+       python metacode/copyrighter.py "Gzz"
 
 # Put here the shell argument line to generate the build tag for the
 # window title
Index: gzz/metacode/copyrighter.py
diff -u gzz/metacode/copyrighter.py:1.10 gzz/metacode/copyrighter.py:1.11
--- gzz/metacode/copyrighter.py:1.10    Fri Feb 21 15:08:25 2003
+++ gzz/metacode/copyrighter.py Fri Feb 28 08:51:57 2003
@@ -1,20 +1,20 @@
 #
 # Copyright (c) 2002, Benja Fallenstein and Tuomas J. Lukka
 #
-# This file is part of Gzz.
+# This file is part of Fenfire.
 # 
-# Gzz is free software; you can redistribute it and/or modify it under
+# Fenfire is free software; you can redistribute it and/or modify it under
 # the terms of the GNU Lesser General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 # 
-# Gzz is distributed in the hope that it will be useful, but WITHOUT
+# Fenfire is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
 # Public License for more details.
 # 
 # You should have received a copy of the GNU Lesser General
-# Public License along with Gzz; if not, write to the Free
+# Public License along with Fenfire; if not, write to the Free
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA
 # 
@@ -23,6 +23,10 @@
 """
 copyrighter.py -- utility to add copyright notices to source files
 
+Invocation:
+
+    python copyrighter.py "Project name" [dir]
+
 This script walks a directory tree and looks for files starting with
 one of the following lines:
 
@@ -30,7 +34,7 @@
 // (c) PERSON
 #(c): PERSON
 
-where PERSON is any string. It then inserts a Gzz-ish copyright statement
+where PERSON is any string. It then inserts a Fenfirish copyright statement
 and license notice, attributing the file to PERSON, quoted by /* */
 in the first and # in the second case. The original tag line is replaced
 by the copyright statement and license notice.
@@ -53,28 +57,29 @@
 import sys, os, os.path, time, re
 
 year = time.localtime()[0]
+project_name = sys.argv[1]
 
 oldStart = re.compile("You may use and distribute")
 oldEnd = re.compile("for more details")
 
 copyright = """
-Copyright (c) %s, %s
+Copyright (c) %(year)s, %(author)s
 """
 
-license = """This file is part of Gzz.
+license = """This file is part of %(name)s.
 
-Gzz is free software; you can redistribute it and/or modify it under
+%(name)s is free software; you can redistribute it and/or modify it under
 the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
-Gzz is distributed in the hope that it will be useful, but WITHOUT
+%(name)s is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
 Public License for more details.
 
 You should have received a copy of the GNU Lesser General
-Public License along with Gzz; if not, write to the Free
+Public License along with %(name)s; if not, write to the Free
 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 MA  02111-1307  USA
 """
@@ -145,6 +150,12 @@
        author = mat.group(2)
        first = firstlines[0]
 
+        params = {
+            'year': year,
+            'author': author,
+            'name': project_name,
+        }
+
        if mat.group(0).startswith('#'):
            pymode = 1
        else:
@@ -155,7 +166,7 @@
            if l[-1] == '\n': lines.append(l[:-1])
            else: lines.append(l)
 
-       notice_lines = (template % (year, author)).split('\n');
+       notice_lines = (template % params).split('\n');
 
        if pymode:
            notice_lines = ['# '+s for s in notice_lines]
@@ -180,8 +191,8 @@
            if m == None:
                print file+":1: not copyrighted"
 
-if len(sys.argv) > 1:
-    dir = sys.argv[1]
+if len(sys.argv) > 2:
+    dir = sys.argv[2]
 else:
     dir = './'
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]