//usr/lib64/lib64//lib64//python2.7/ó
àœSec @ sz d Z d a d d l Z d d l Z d d l Z d a d a d a d d „ Z d „ Z d „ Z
e d k rv e ƒ n d S(
så (Ostensibly) fix copyright notices in files.
Actually, this sript 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.
s¸ /***********************************************************
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.
******************************************************************/
iÿÿÿÿNt i c C s+ t t ƒ GH| r | GHn t j | ƒ d S( N( t __doc__t globalst syst exit( t codet msg( ( s/ /usr/lib64/python2.7/Tools/scripts/fixnotice.pyt usage4 s c C s6 y5 t j t j d d d d d d d g ƒ \ } } Wn# t j k
rZ } t d | ƒ n Xx¹ | D]± \ } } | d k r‡ t d
ƒ qb | d k rœ d a qb | d
k r± d a qb | d k râ t | ƒ } | j ƒ a | j
ƒ qb | d k rb t | ƒ } | j ƒ a | j
ƒ qb qb Wx | D] } t | ƒ qWd S( Ni t hvt helps
oldnotice=s
newnotice=s dry-runt verboses -hs --helpi s -vs --verboses --dry-runs --oldnotices --newnotice( s -hs --help( s -vs --verbose(
t getoptR t argvt errorR t VERBOSEt DRYRUNt opent readt
OLD_NOTICEt closet
NEW_NOTICEt process( t optst argsR t optt argt fp( ( s/ /usr/lib64/python2.7/Tools/scripts/fixnotice.pyt main; s.
c C só t | ƒ } | j ƒ } | j ƒ | j t ƒ } | d k rS t rO d G| GHn d St s_ t rk d G| GHn t ru d S| | t | | t t ƒ } | d } | d } t | d ƒ } | j | ƒ | j ƒ t
j | | ƒ t
j | | ƒ d S( Ni s
no change:s
change:s .news .bakt w( R R R t findR R R R t lent writet ost rename( t filet ft datat it newt backup( ( s/ /usr/lib64/python2.7/Tools/scripts/fixnotice.pyR X s(
t __main__( R R R R R R R R R R R t __name__( ( ( s/ /usr/lib64/python2.7/Tools/scripts/fixnotice.pyt s