Mercurial > hg
comparison i18n/hggettext @ 33819:d5ef17608159
i18n: ignore docstring for modules under mercurial
Docstring of modules is needed only for "hg help -e EXTNAME".
This is a preparation for applying hggettext on util.py, which has
module docstring, but it isn't needed for translation.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 15 Aug 2017 21:06:26 +0900 |
parents | ed04d7254a91 |
children | 0585337ea787 |
comparison
equal
deleted
inserted
replaced
33818:ed04d7254a91 | 33819:d5ef17608159 |
---|---|
101 | 101 |
102 This respects the Mercurial cmdtable/table convention and will | 102 This respects the Mercurial cmdtable/table convention and will |
103 only extract docstrings from functions mentioned in these tables. | 103 only extract docstrings from functions mentioned in these tables. |
104 """ | 104 """ |
105 mod = importpath(path) | 105 mod = importpath(path) |
106 if mod.__doc__: | 106 if not path.startswith('mercurial/') and mod.__doc__: |
107 src = open(path).read() | 107 src = open(path).read() |
108 lineno = 1 + offset(src, mod.__doc__, path, 7) | 108 lineno = 1 + offset(src, mod.__doc__, path, 7) |
109 print(poentry(path, lineno, mod.__doc__)) | 109 print(poentry(path, lineno, mod.__doc__)) |
110 | 110 |
111 functions = list(getattr(mod, 'i18nfunctions', [])) | 111 functions = list(getattr(mod, 'i18nfunctions', [])) |