comparison mercurial/templater.py @ 43674:5be909dbe385

util: remove datapath and swith users over to resourceutil The util module no longer needs the datapath for injecting it into the i18n module, so we can remove it from there and update other users. Differential Revision: https://phab.mercurial-scm.org/D7436
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 13:18:22 -0800
parents 70d42e2ad9b4
children fc1fa3a07af6
comparison
equal deleted inserted replaced
43673:f0bee3b1b847 43674:5be909dbe385
78 templatefilters, 78 templatefilters,
79 templatefuncs, 79 templatefuncs,
80 templateutil, 80 templateutil,
81 util, 81 util,
82 ) 82 )
83 from .utils import stringutil 83 from .utils import (
84 resourceutil,
85 stringutil,
86 )
84 87
85 # template parsing 88 # template parsing
86 89
87 elements = { 90 elements = {
88 # token-type: binding-strength, primary, prefix, infix, suffix 91 # token-type: binding-strength, primary, prefix, infix, suffix
1040 1043
1041 1044
1042 def templatepaths(): 1045 def templatepaths():
1043 '''return locations used for template files.''' 1046 '''return locations used for template files.'''
1044 pathsrel = [b'templates'] 1047 pathsrel = [b'templates']
1045 paths = [os.path.normpath(os.path.join(util.datapath, f)) for f in pathsrel] 1048 paths = [
1049 os.path.normpath(os.path.join(resourceutil.datapath, f))
1050 for f in pathsrel
1051 ]
1046 return [p for p in paths if os.path.isdir(p)] 1052 return [p for p in paths if os.path.isdir(p)]
1047 1053
1048 1054
1049 def templatepath(name): 1055 def templatepath(name):
1050 '''return location of template file. returns None if not found.''' 1056 '''return location of template file. returns None if not found.'''