##// END OF EJS Templates
util: remove datapath and swith users over to resourceutil...
Martin von Zweigbergk -
r44070:5be909db default
parent child Browse files
Show More
@@ -36,7 +36,10 b' from . import ('
36 util,
36 util,
37 )
37 )
38 from .hgweb import webcommands
38 from .hgweb import webcommands
39 from .utils import compression
39 from .utils import (
40 compression,
41 resourceutil,
42 )
40
43
41 _exclkeywords = {
44 _exclkeywords = {
42 b"(ADVANCED)",
45 b"(ADVANCED)",
@@ -311,7 +314,7 b' def loaddoc(topic, subdir=None):'
311 """Return a delayed loader for help/topic.txt."""
314 """Return a delayed loader for help/topic.txt."""
312
315
313 def loader(ui):
316 def loader(ui):
314 docdir = os.path.join(util.datapath, b'helptext')
317 docdir = os.path.join(resourceutil.datapath, b'helptext')
315 if subdir:
318 if subdir:
316 docdir = os.path.join(docdir, subdir)
319 docdir = os.path.join(docdir, subdir)
317 path = os.path.join(docdir, topic + b".txt")
320 path = os.path.join(docdir, topic + b".txt")
@@ -15,6 +15,8 b' from . import ('
15 util,
15 util,
16 )
16 )
17
17
18 from .utils import resourceutil
19
18 if pycompat.iswindows:
20 if pycompat.iswindows:
19 from . import scmwindows as scmplatform
21 from . import scmwindows as scmplatform
20 else:
22 else:
@@ -62,7 +64,7 b' def envrcitems(env=None):'
62 def defaultrcpath():
64 def defaultrcpath():
63 '''return rc paths in defaultrc'''
65 '''return rc paths in defaultrc'''
64 path = []
66 path = []
65 defaultpath = os.path.join(util.datapath, b'defaultrc')
67 defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
66 if os.path.isdir(defaultpath):
68 if os.path.isdir(defaultpath):
67 path = _expandrcpath(defaultpath)
69 path = _expandrcpath(defaultpath)
68 return path
70 return path
@@ -80,7 +80,10 b' from . import ('
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
@@ -1042,7 +1045,10 b' class templater(object):'
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
@@ -54,7 +54,6 b' from . import ('
54 from .utils import (
54 from .utils import (
55 compression,
55 compression,
56 procutil,
56 procutil,
57 resourceutil,
58 stringutil,
57 stringutil,
59 )
58 )
60
59
@@ -1823,9 +1822,6 b' def pathto(root, n1, n2):'
1823 return pycompat.ossep.join(([b'..'] * len(a)) + b) or b'.'
1822 return pycompat.ossep.join(([b'..'] * len(a)) + b) or b'.'
1824
1823
1825
1824
1826 datapath = resourceutil.datapath
1827
1828
1829 def checksignature(func):
1825 def checksignature(func):
1830 '''wrap a function with code to check for calling errors'''
1826 '''wrap a function with code to check for calling errors'''
1831
1827
General Comments 0
You need to be logged in to leave comments. Login now