tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/support update-copyrights.py
Date Sat, 01 Feb 2003 16:47:52 GMT
hlship      2003/02/01 08:47:52

  Modified:    support  update-copyrights.py
  Log:
  Improve the update-copyrights tool to allow multiple directories, and to provide a count
of updated files at the end.
  
  Revision  Changes    Path
  1.2       +18 -4     jakarta-tapestry/support/update-copyrights.py
  
  Index: update-copyrights.py
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/support/update-copyrights.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- update-copyrights.py	13 Jan 2003 03:31:58 -0000	1.1
  +++ update-copyrights.py	1 Feb 2003 16:47:52 -0000	1.2
  @@ -8,6 +8,8 @@
   from stat import *
   import re
   
  +updateCount = 0;
  +
   packageRe = re.compile(r'^\s*package\s+');
   
   def walktree(dir, callback):
  @@ -116,6 +118,10 @@
   	
   	os.remove(saveFile)
   	
  +	global updateCount
  +	
  +	updateCount = updateCount + 1
  +	
   	return 1
   								
   	
  @@ -134,10 +140,18 @@
   			
   			
   if __name__ == '__main__':
  -    global copyright
  +	global copyright
       
  -    copyright = readCopyright(sys.argv[1])
  -    walktree(sys.argv[2], visitfile)
  +	copyright = readCopyright(sys.argv[1])
  +	
  +	for dir in sys.argv[2:]:
  +		walktree(dir, visitfile)
  +
  +	print
   
  +	if updateCount == 0:
  +		print "All files up to date."
  +	else:
  +		print "Updated %d files." % updateCount
   	
   
  
  
  

Mime
View raw message