Show More
@@ -829,17 +829,22 b' def _readmapfile(fp, mapfile):' | |||
|
829 | 829 | conf = config.config() |
|
830 | 830 | |
|
831 | 831 | def include(rel, remap, sections): |
|
832 | templatedirs = [base, templatedir()] | |
|
833 | for dir in templatedirs: | |
|
834 | if dir is None: | |
|
835 | continue | |
|
836 | abs = os.path.normpath(os.path.join(dir, rel)) | |
|
832 | subresource = None | |
|
833 | if base: | |
|
834 | abs = os.path.normpath(os.path.join(base, rel)) | |
|
837 | 835 | if os.path.isfile(abs): |
|
838 |
|
|
|
839 | conf.parse( | |
|
840 | abs, data, sections=sections, remap=remap, include=include | |
|
841 |
|
|
|
842 | break | |
|
836 | subresource = util.posixfile(abs, b'rb') | |
|
837 | if not subresource: | |
|
838 | dir = templatedir() | |
|
839 | if dir: | |
|
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 | 849 | data = fp.read() |
|
845 | 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