1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#!/usr/bin/env python
# $Id: setup.py,v 1.4 2001/07/19 02:36:35 hierro Exp $
"""A setup module for the Cheetah package, based on the disutils module
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.4 $
Start Date: 2001/03/30
Last Revision Date: $Date: 2001/07/19 02:36:35 $
"""
__author__ = "Tavis Rudd <tavis@calrudd.com>"
__version__ = "$Revision: 1.4 $"[11:-2]
##################################################
## DEPENDENCIES ##
from distutils.core import setup
from distutils.command.sdist import sdist
import os
import os.path
import re
##################################################
## CONSTANTS & GLOBALS ##
True = (1==1)
False = (0==1)
##################################################
## CLASSES ##
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)
##################################################
## if run from the command line ##
if __name__ == '__main__':
from src.Version import version
from src import __doc__
README = open('README','w')
README.write(__doc__)
README.close()
synopsis = __doc__.split('\n')[0]
packages = ['Cheetah',
'Cheetah.Templates',
'Cheetah.Plugins',
'Cheetah.Macros',
'Cheetah.Tests',
'Cheetah.Tools',
]
setup (name = "Cheetah",
author = "The Cheetah Development Team",
author_email = "cheetahtemplate-devel@sourceforge.net",
version = version,
license = "The Python License",
description = synopsis,
long_description = __doc__,
maintainer = "Tavis Rudd",
url = "http://www.calrudd.com/tavis",
packages = packages,
package_dir = {'Cheetah':'src'},
scripts = ['bin/cheetah-compile',],
cmdclass = { 'sdist_docs' : sdist_docs },
)
|