gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./changedJava.pl gzz/vob/vobs/CalendarVob.j...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./changedJava.pl gzz/vob/vobs/CalendarVob.j...
Date: Fri, 21 Feb 2003 11:08:01 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/02/21 11:08:01

Modified files:
        .              : changedJava.pl 
        gzz/vob/vobs   : CalendarVob.java 
        metacode       : copyrighter.py 
        test/gzz/mem   : partition.test 

Log message:
        More flexible copyrighting

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/changedJava.pl.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/vobs/CalendarVob.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/copyrighter.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/mem/partition.test.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: gzz/changedJava.pl
diff -u gzz/changedJava.pl:1.3 gzz/changedJava.pl:1.4
--- gzz/changedJava.pl:1.3      Sun Jun 30 07:34:01 2002
+++ gzz/changedJava.pl  Fri Feb 21 11:08:01 2003
@@ -1,4 +1,21 @@
 #!/usr/bin/perl -w
+# 
+# Copyright (c) 2003, Tuomas J. Lukka
+# 
+# You may use and distribute under the terms of either the GNU Lesser
+# General Public License, either version 2 of the license or,
+# at your choice, any later version. Alternatively, you may use and
+# distribute under the terms of the XPL.
+# 
+# See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
+# the licenses.
+# 
+# This software 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 README
+# file for more details.
+# 
+
 #
 # Look at which parameter Java source files have changed since their 
respective .class
 # files were compiled.
Index: gzz/gzz/vob/vobs/CalendarVob.java
diff -u gzz/gzz/vob/vobs/CalendarVob.java:1.4 
gzz/gzz/vob/vobs/CalendarVob.java:1.5
--- gzz/gzz/vob/vobs/CalendarVob.java:1.4       Tue Jan 14 18:11:07 2003
+++ gzz/gzz/vob/vobs/CalendarVob.java   Fri Feb 21 11:08:01 2003
@@ -1,5 +1,25 @@
-
-// (c) Matti Katila
+/*
+CalendarVob.java
+ *    
+ *    Copyright (c) 2003, Matti Katila
+ *    
+ *    You may use and distribute under the terms of either the GNU Lesser
+ *    General Public License, either version 2 of the license or,
+ *    at your choice, any later version. Alternatively, you may use and
+ *    distribute under the terms of the XPL.
+ *    
+ *    See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
+ *    the licenses.
+ *    
+ *    This software 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 README
+ *    file for more details.
+ *    
+ */
+/*
+ * Written by Matti Katila
+ */
 
 package gzz.vob.vobs;
 import gzz.vob.*;
@@ -13,7 +33,7 @@
 import java.util.*;
 
 public class CalendarVob extends Vob {
-public static final String rcsid = "$Id: CalendarVob.java,v 1.4 2003/01/14 
23:11:07 mudyc Exp $";
+public static final String rcsid = "$Id: CalendarVob.java,v 1.5 2003/02/21 
16:08:01 tjl Exp $";
     public static boolean dbg = false;
     static final void p(String s) { if(dbg) System.out.println(s); }
     static final void pa(String s) { System.out.println(s); }
Index: gzz/metacode/copyrighter.py
diff -u gzz/metacode/copyrighter.py:1.4 gzz/metacode/copyrighter.py:1.5
--- gzz/metacode/copyrighter.py:1.4     Fri Feb 21 10:57:39 2003
+++ gzz/metacode/copyrighter.py Fri Feb 21 11:08:01 2003
@@ -76,27 +76,29 @@
  */
 """
 
+doCopyrightRe = re.compile(r"(?://|#)\s*\([cC]\)\s*:?\s*([^\n]+)")
+
 def process_dir(arg, dir, names):
     for name in names:
         file = os.path.join(dir, name)
         if os.path.isdir(file): continue
-        firstlines = open(file, 'r').readlines(500)
-       if not len(firstlines): continue
+        firstlines = open(file, 'r').readlines(1000)
+       if len(firstlines) < 2: continue
 
-       mat = re.match(r"(?://|#)\s*\([cC]\)\s*([^\n]+)", firstlines[0])
+       theLine = 0
+       mat = doCopyrightRe.match(firstlines[0])
+       if mat == None: 
+           mat = doCopyrightRe.match(firstlines[1])
+           theLine = 1
 
         if mat != None:
            author = mat.group(1)
            first = firstlines[0]
 
             if first.startswith('#'):
-                pymode = 1; chars = 5
+                pymode = 1
             else:
                 pymode = 0;
-               if first.startswith('// '):
-                   chars = 7
-               else:
-                   chars = 6
 
             lines = []
             for l in open(file, 'r').readlines():
@@ -113,10 +115,9 @@
             if not pymode:
                 notice = '\n'.join(notice_lines)
                 notice = java_template % (name, notice, author)
-                text = notice + '\n'.join(lines[1:]) + '\n'
+                text = '\n'.join(lines[0:theLine]) + notice + 
'\n'.join(lines[(theLine+1):]) + '\n'
             else:
-                lines = lines[1:]
-                lines[0:0] = notice_lines + ['']
+                lines[theLine:(theLine+1)] = notice_lines + ['']
                 text = '\n'.join(lines) + '\n'
 
             print "Inserting copyright statement into file %s" % (file,)
Index: gzz/test/gzz/mem/partition.test
diff -u gzz/test/gzz/mem/partition.test:1.10 
gzz/test/gzz/mem/partition.test:1.11
--- gzz/test/gzz/mem/partition.test:1.10        Mon Jan 20 02:00:53 2003
+++ gzz/test/gzz/mem/partition.test     Fri Feb 21 11:08:01 2003
@@ -1,5 +1,25 @@
-from __future__ import nested_scopes
-#(c): Tuomas J. Lukka
+from __future__ import nested_scopes/*
+partition.test
+ *    
+ *    Copyright (c) 2003, Tuomas J. Lukka
+ *    
+ *    You may use and distribute under the terms of either the GNU Lesser
+ *    General Public License, either version 2 of the license or,
+ *    at your choice, any later version. Alternatively, you may use and
+ *    distribute under the terms of the XPL.
+ *    
+ *    See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
+ *    the licenses.
+ *    
+ *    This software 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 README
+ *    file for more details.
+ *    
+ */
+/*
+ * Written by Tuomas J. Lukka
+ */
 
 import gzz
 import java




reply via email to

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