Your IP : 216.73.216.213
�
e f� � @ s� d Z d a d d l Z d d l Z d d l Z d a d a d a d d d � Z d d � Z d d
� Z
e d k r e � n d S)a� (Ostensibly) fix copyright notices in files.
Actually, this script will simply replace a block of text in a file from one
string to another. It will only do this once though, i.e. not globally
throughout the file. It writes a backup file and then does an os.rename()
dance for atomicity.
Usage: fixnotices.py [options] [filenames]
Options:
-h / --help
Print this message and exit
--oldnotice=file
Use the notice in the file as the old (to be replaced) string, instead
of the hard coded value in the script.
--newnotice=file
Use the notice in the file as the new (replacement) string, instead of
the hard coded value in the script.
--dry-run
Don't actually make the changes, but print out the list of files that
would change. When used with -v, a status will be printed for every
file.
-v / --verbose
Print a message for every file looked at, indicating whether the file
is changed or not.
a� /***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
All rights reserved.
See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/
� N� c C s5 t t t � � | r$ t | � n t j | � d S)N)�print�__doc__�globals�sys�exit)�code�msg� r
�</opt/alt/python34/lib64/python3.4/Tools/scripts/fixnotice.py�usage4 s
r c C sN y; t j t j d d � d d d d d d g � \ } } Wn5 t j k
rr } z t d | � WYd d } ~ Xn Xx� | D]� \ } } | d k r� t d
� qz | d k r� d a qz | d
k r� d a qz | d k r� t | � } | j � a | j
� qz | d k rz t | � } | j � a | j
� qz qz Wx | D] } t | � q6Wd S)N� Zhv�helpz
oldnotice=z
newnotice=zdry-run�verbose�-h�--helpr �-v� --verbosez --dry-runz--oldnoticez--newnotice)r r )r r )
�getoptr �argv�errorr �VERBOSE�DRYRUN�open�read�
OLD_NOTICE�close�
NEW_NOTICE�process)Zopts�argsr Zopt�arg�fpr
r
r �main; s.
r"