Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/extensions.py @ 14530:cd31a1cc1521
extensions: update doc of enabled() and disabled() according to d5b525697ddb
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 04 Jun 2011 20:01:01 +0900 |
parents | c238b12a1ed4 |
children | 558ec14ba6be |
comparison
equal
deleted
inserted
replaced
14529:e7a1814854b9 | 14530:cd31a1cc1521 |
---|---|
259 return gettext(doc).splitlines()[0] | 259 return gettext(doc).splitlines()[0] |
260 else: | 260 else: |
261 return _('(no help text available)') | 261 return _('(no help text available)') |
262 | 262 |
263 def disabled(): | 263 def disabled(): |
264 '''find disabled extensions from hgext | 264 '''find disabled extensions from hgext. returns a dict of {name: desc}''' |
265 returns a dict of {name: desc}, and the max name length''' | |
266 | |
267 paths = _disabledpaths() | 265 paths = _disabledpaths() |
268 if not paths: | 266 if not paths: |
269 return None | 267 return None |
270 | 268 |
271 exts = {} | 269 exts = {} |
326 return ext | 324 return ext |
327 | 325 |
328 raise error.UnknownCommand(cmd) | 326 raise error.UnknownCommand(cmd) |
329 | 327 |
330 def enabled(): | 328 def enabled(): |
331 '''return a dict of {name: desc} of extensions, and the max name length''' | 329 '''return a dict of {name: desc} of extensions''' |
332 exts = {} | 330 exts = {} |
333 for ename, ext in extensions(): | 331 for ename, ext in extensions(): |
334 doc = (gettext(ext.__doc__) or _('(no help text available)')) | 332 doc = (gettext(ext.__doc__) or _('(no help text available)')) |
335 ename = ename.split('.')[-1] | 333 ename = ename.split('.')[-1] |
336 exts[ename] = doc.splitlines()[0].strip() | 334 exts[ename] = doc.splitlines()[0].strip() |