##// END OF EJS Templates
templater: unroll loop over mapfile directories...
Martin von Zweigbergk -
r45872:d9a502a0 default
parent child Browse files
Show More
@@ -829,17 +829,22 b' def _readmapfile(fp, mapfile):'
829 conf = config.config()
829 conf = config.config()
830
830
831 def include(rel, remap, sections):
831 def include(rel, remap, sections):
832 templatedirs = [base, templatedir()]
832 subresource = None
833 for dir in templatedirs:
833 if base:
834 if dir is None:
834 abs = os.path.normpath(os.path.join(base, rel))
835 continue
836 abs = os.path.normpath(os.path.join(dir, rel))
837 if os.path.isfile(abs):
835 if os.path.isfile(abs):
838 data = util.posixfile(abs, b'rb').read()
836 subresource = util.posixfile(abs, b'rb')
839 conf.parse(
837 if not subresource:
840 abs, data, sections=sections, remap=remap, include=include
838 dir = templatedir()
841 )
839 if dir:
842 break
840 abs = os.path.normpath(os.path.join(dir, rel))
841 if os.path.isfile(abs):
842 subresource = util.posixfile(abs, b'rb')
843 if subresource:
844 data = subresource.read()
845 conf.parse(
846 abs, data, sections=sections, remap=remap, include=include,
847 )
843
848
844 data = fp.read()
849 data = fp.read()
845 conf.parse(mapfile, data, remap={b'': b'templates'}, include=include)
850 conf.parse(mapfile, data, remap={b'': b'templates'}, include=include)
General Comments 0
You need to be logged in to leave comments. Login now