Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv3615
Modified Files:
setup.py
Log Message:
Update pymerase.config.table_dtd to point to the installed location of
the table.dtd file
Index: setup.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/setup.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** setup.py 14 Jun 2003 01:24:10 -0000 1.11
--- setup.py 21 Jun 2003 01:30:17 -0000 1.12
***************
*** 36,45 ****
from distutils.core import Extension
import glob
- import shutil
import os
import sys
from ParseCVS import CvsTreeUtil
util = CvsTreeUtil()
--- 36,73 ----
from distutils.core import Extension
import glob
import os
+ import re
+ import string
+ import shutil
import sys
from ParseCVS import CvsTreeUtil
+ def createPackageConfig(dtdFile):
+ if not dtdFile[0:5] in ('file:', 'http:'):
+ dtdFile = 'file:' + dtdFile
+ configFile = open('pymerase/config.py', 'r')
+ configLines = configFile.readlines()
+ configFile.close()
+
+ newConfig = []
+ for l in configLines:
+ if re.match('table_dtd=',l):
+ newConfig.append(re.sub('^table_dtd=.*', 'table_dtd="%s"' % (dtdFile), l))
+ else:
+ newConfig.append(l)
+
+ print string.join(newConfig, '')
+ savePackageConfig(newConfig)
+ return configLines
+
+ def savePackageConfig(configLines):
+ """save the contents of the pyermase.config file
+ """
+ configFile = open('pymerase/config.py', 'w')
+ configFile.write(string.join(configLines, ''))
+ configFile.close()
+
+
util = CvsTreeUtil()
***************
*** 70,73 ****
--- 98,102 ----
binPath = None
docPath = None
+ dtdFile = None
#look for custom command line args
***************
*** 83,86 ****
--- 112,119 ----
rmList.append(item)
+ if item[:10] == '--dtdFile=':
+ dtdFile = item[10:]
+ rmList.append(item)
+
#Remove processed items from sys.argv
for item in rmList:
***************
*** 117,120 ****
--- 150,160 ----
docPath = 'pymerase'
+ if dtdFile is None:
+ if sys.platform == 'win32':
+ dtdFile = '..\\Program Files\\Pymerase\\sgml\\dtd\\table.dtd'
+ else:
+ dtdFile = '/usr/share/sgml/dtd/table.dtd'
+
+
#################################
# Setup Data Files
***************
*** 124,127 ****
--- 164,169 ----
README_TUPLE=(docPath, ['README', 'INSTALL'])
+ DTD_TUPLE=(dtdFile, ['examples/table.dtd'])
+
# ignore this until someone fixes it.
#WEBUTIL_TEMPLATES_TUPLE=(os.path.join(prefix, 'templates/webUtil'),
***************
*** 130,133 ****
--- 172,176 ----
DATA_FILES=[BIN_TUPLE,
README_TUPLE,
+ DTD_TUPLE,
# WEBUTIL_TEMPLATES_TUPLE
]
***************
*** 138,141 ****
--- 181,185 ----
#FIXME: Grabs .cvsignore files, need to add filter
+ oldConfig = createPackageConfig(dtdFile)
#Run setup! =o)
***************
*** 150,151 ****
--- 194,197 ----
packages=PACKAGES,
data_files=DATA_FILES)
+
+ savePackageConfig(oldConfig)
|