##// END OF EJS Templates
extensions: simplify by selecting primary hgext
Dirkjan Ochtman -
r8872:d0c0013f default
parent child Browse files
Show More
@@ -134,17 +134,20 def pathdirs():
134 def disabled():
134 def disabled():
135 '''find disabled extensions from hgext
135 '''find disabled extensions from hgext
136 returns a dict of {name: desc}, and the max name length'''
136 returns a dict of {name: desc}, and the max name length'''
137
138 import hgext
139 extpath = os.path.dirname(os.path.abspath(hgext.__file__))
140
137 exts = {}
141 exts = {}
138 maxlength = 0
142 maxlength = 0
139 for dir in filter(os.path.isdir,
143 for e in os.listdir(extpath):
140 (os.path.join(pd, 'hgext') for pd in pathdirs())):
144
141 for e in os.listdir(dir):
142 if e.endswith('.py'):
145 if e.endswith('.py'):
143 name = e.rsplit('.', 1)[0]
146 name = e.rsplit('.', 1)[0]
144 path = os.path.join(dir, e)
147 path = os.path.join(extpath, e)
145 else:
148 else:
146 name = e
149 name = e
147 path = os.path.join(dir, e, '__init__.py')
150 path = os.path.join(extpath, e, '__init__.py')
148
151
149 if name in exts or name == '__init__' or not os.path.exists(path):
152 if name in exts or name == '__init__' or not os.path.exists(path):
150 continue
153 continue
@@ -168,6 +171,7 def disabled():
168 exts[name] = gettext(doc).splitlines()[0]
171 exts[name] = gettext(doc).splitlines()[0]
169 else:
172 else:
170 exts[name] = _('(no help text available)')
173 exts[name] = _('(no help text available)')
174
171 if len(name) > maxlength:
175 if len(name) > maxlength:
172 maxlength = len(name)
176 maxlength = len(name)
173
177
General Comments 0
You need to be logged in to leave comments. Login now