/[gzz]/gzz/metacode/copyrighter.py
ViewVC logotype

Diff of /gzz/metacode/copyrighter.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by benja, Thu Jul 25 07:07:10 2002 UTC revision 1.2 by benja, Fri Sep 13 11:48:32 2002 UTC
# Line 1  Line 1 
1  #  #
2  # Copyright (c) 2002, Benja Fallenstein  # Copyright (c) 2002, Benja Fallenstein
3  #  #
4  # You may use and distribute under the terms of either the GNU Lesser  # You may use and distribute under the terms of either the GNU Lesser
5  # General Public License, either version 2 of the license or,  # General Public License, either version 2 of the license or,
6  # at your choice, any later version. Alternatively, you may use and  # at your choice, any later version. Alternatively, you may use and
7  # distribute under the terms of the XPL.  # distribute under the terms of the XPL.
8  #  #
9  # See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of  # See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
10  # the licenses.  # the licenses.
11  #  #
12  # This software is distributed in the hope that it will be useful,  # This software is distributed in the hope that it will be useful,
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of  # but WITHOUT ANY WARRANTY; without even the implied warranty of
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the README  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the README
15  # file for more details.  # file for more details.
16  #  #
17    
18  """  """
19  copyrighter.py -- utility to add copyright notices to source files  copyrighter.py -- utility to add copyright notices to source files
# Line 22  This script walks a directory tree and l Line 22  This script walks a directory tree and l
22  one of the following lines:  one of the following lines:
23    
24  //(c): PERSON  //(c): PERSON
25    // (c) PERSON
26  #(c): PERSON  #(c): PERSON
27    
28  where PERSON is any string. It then inserts a Gzz-ish copyright statement  where PERSON is any string. It then inserts a Gzz-ish copyright statement
# Line 70  def process_dir(arg, dir, names): Line 71  def process_dir(arg, dir, names):
71      for name in names:      for name in names:
72          file = os.path.join(dir, name)          file = os.path.join(dir, name)
73          if os.path.isdir(file): continue          if os.path.isdir(file): continue
74          first = open(file, 'r').read(6)          first = open(file, 'r').read(7)
75    
76          if first.startswith('//(c):') or first.startswith('#(c):'):          if first.startswith('//(c):') or first.startswith('#(c):') or \
77               first.startswith('// (c) '):
78              if first.startswith('#'):              if first.startswith('#'):
79                  pymode = 1; chars = 5                  pymode = 1; chars = 5
80              else:              else:
81                  pymode = 0; chars = 6                  pymode = 0;
82                    if first.startswith('// '):
83                        chars = 7
84                    else:
85                        chars = 6
86    
87              lines = []              lines = []
88              for l in open(file, 'r').readlines():              for l in open(file, 'r').readlines():

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26