diff options
author | tavis_rudd <tavis_rudd> | 2001-06-13 05:10:16 +0000 |
---|---|---|
committer | tavis_rudd <tavis_rudd> | 2001-06-13 05:10:16 +0000 |
commit | 083fdea9765a1aa833cc71c7ece369971e58c1e3 (patch) | |
tree | 2bf36c8d2c08ca5e5594658582892f55a7cdd101 /setup.py | |
parent | bd5f1ae246b1e57888dc5e12855bd84a70d6ee68 (diff) | |
download | python-cheetah-083fdea9765a1aa833cc71c7ece369971e58c1e3.tar.gz |
updated the setup command 'sdist_docs' so it will automatically update the
version number in the Users Guide.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: setup.py,v 1.1 2001/06/13 03:50:36 tavis_rudd Exp $ +# $Id: setup.py,v 1.2 2001/06/13 05:10:16 tavis_rudd Exp $ """A setup module for the Cheetah package, based on the disutils module Meta-Data @@ -7,20 +7,24 @@ Meta-Data Author: Tavis Rudd <tavis@calrudd.com> License: This software is released for unlimited distribution under the terms of the Python license. -Version: $Revision: 1.1 $ +Version: $Revision: 1.2 $ Start Date: 2001/03/30 -Last Revision Date: $Date: 2001/06/13 03:50:36 $ +Last Revision Date: $Date: 2001/06/13 05:10:16 $ """ __author__ = "Tavis Rudd <tavis@calrudd.com>" -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] ################################################## ## DEPENDENCIES ## -import os -import os.path + + from distutils.core import setup from distutils.command.sdist import sdist +import os +import os.path +import re + ################################################## ## CONSTANTS & GLOBALS ## @@ -35,12 +39,25 @@ class sdist_docs(sdist): """a setup command that will rebuild Users Guide""" def run(self): try: + from src.Version import version + currentDir = os.getcwd() os.chdir(os.path.join(currentDir,'docs','src')) + fp = open('users_guide.tex','r') + originalTexCode = fp.read() + fp.close() + + newTexCode = re.sub(r'(?<=\\release\{)[0-9\.]*',str(version), originalTexCode) + + fp = open('users_guide.tex','w') + fp.write(newTexCode) + fp.close() + os.system('make -f Makefile') os.chdir(currentDir) except: print "The sdist_docs command couldn't rebuild the Users Guide" + os.chdir(currentDir) sdist.run(self) @@ -49,9 +66,9 @@ class sdist_docs(sdist): ## if run from the command line ## if __name__ == '__main__': - from Cheetah.Version import version + from src.Version import version - from Cheetah import __doc__ + from src import __doc__ README = open('README','w') README.write(__doc__) README.close() |