comparison markup/template.py @ 133:79f445396cd7 trunk

Minor cleanup and performance improvement for the builder module.
author cmlenz
date Sun, 06 Aug 2006 17:10:47 +0000
parents c9f0a26e28a2
children d681d2c3cd8d
comparison
equal deleted inserted replaced
132:dc42cb3c02dc 133:79f445396cd7
1062 search_path = [os.path.dirname(filename)] 1062 search_path = [os.path.dirname(filename)]
1063 1063
1064 for dirname in search_path: 1064 for dirname in search_path:
1065 filepath = os.path.join(dirname, filename) 1065 filepath = os.path.join(dirname, filename)
1066 try: 1066 try:
1067 fileobj = file(filepath, 'rt') 1067 fileobj = open(filepath, 'U')
1068 try: 1068 try:
1069 tmpl = Template(fileobj, basedir=dirname, filename=filename) 1069 tmpl = Template(fileobj, basedir=dirname, filename=filename)
1070 tmpl.filters.append(IncludeFilter(self)) 1070 tmpl.filters.append(IncludeFilter(self))
1071 finally: 1071 finally:
1072 fileobj.close() 1072 fileobj.close()
Copyright (C) 2012-2017 Edgewall Software