Update of /cvsroot/docstring/web
In directory usw-pr-cvs1:/tmp/cvs-serv12200/web
Modified Files:
templater.py
Log Message:
x-platform fixes
Index: templater.py
===================================================================
RCS file: /cvsroot/docstring/web/templater.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** templater.py 2001/07/22 22:42:42 1.1
--- templater.py 2001/08/04 15:07:26 1.2
***************
*** 35,39 ****
def scanfile(path, file):
##print >>sys.stderr, 'path=%s, file=%s' % (path, file)
! inputlines = string2lines(open(os.path.join(path, file)).read())
sm = StateMachine([ScanState], initialstate='ScanState')
results = sm.run(inputlines)
--- 35,40 ----
def scanfile(path, file):
##print >>sys.stderr, 'path=%s, file=%s' % (path, file)
! filename = os.path.normpath(os.path.join(path, file))
! inputlines = string2lines(open(filename).read())
sm = StateMachine([ScanState], initialstate='ScanState')
results = sm.run(inputlines)
***************
*** 85,89 ****
def main(template, path, files):
! templatelines = open(template).readlines()
output = templater(templatelines, path, files)
outputname = template[:template.rfind('.')]
--- 86,92 ----
def main(template, path, files):
! templatetext = open(template).read()
! templatetext = templatetext.replace("\r\n", "\n").replace("\r", "\n")
! templatelines = templatetext.splitlines(1)
output = templater(templatelines, path, files)
outputname = template[:template.rfind('.')]
|