I have a number of text files which need to be checked into CVS.
Each file needs a special text header/footer in order that CVS can track
changes and version numbers.

Python to the rescue.

I've written a small python program which will write the header/footer to
all files in the current directory.

In order to do this, I need to add this string in my python program.

cvs_header='''
#######################################
#
# $Header:$
#
# $Revision:$
# $Author:$
# $Date:$
#
'''

It works just fine.


However, the program which I wrote also needs to be kept under version
control.
When I make changes to that program, I noticed that the header above gets
modified by cvs, because it contains key variables which are recognized by
cvs.

This is unacceptable.

So I took this string out of my program, wrote it to a pickle file, and now
the pickle file is read at runtime, and the program will write the empty
header to the target files.
I can check the pickle files into cvs as binary files, and the header
strings will not be modified.

I now have 3 pickle files I need to distribute with the program, which is a
minor nuisance. Even using py2exe on Windows, these 3 files cannot be
embedded within the exe itself.

What I'd like to know, is there a way I can embed/endcode the cvs string
above in the python script, so that when that script is modified and checked
into cvs, that the cvs header string above will not be modified by cvs?
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to