Mercurial > public > mercurial-scm > hg
comparison doc/gendoc.py @ 9241:d98cef25b5af
Merge with crew-stable
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Fri, 24 Jul 2009 15:28:29 +0200 |
parents | d6eecafaf12f b6cb3af61582 |
children | 5043a5b16d91 |
comparison
equal
deleted
inserted
replaced
9234:65719472bfa2 | 9241:d98cef25b5af |
---|---|
3 sys.path.insert(0, "..") | 3 sys.path.insert(0, "..") |
4 # fall back to pure modules if required C extensions are not available | 4 # fall back to pure modules if required C extensions are not available |
5 sys.path.append(os.path.join('..', 'mercurial', 'pure')) | 5 sys.path.append(os.path.join('..', 'mercurial', 'pure')) |
6 from mercurial import demandimport; demandimport.enable() | 6 from mercurial import demandimport; demandimport.enable() |
7 from mercurial.commands import table, globalopts | 7 from mercurial.commands import table, globalopts |
8 from mercurial.i18n import gettext, _ | 8 from mercurial.i18n import _ |
9 from mercurial.help import helptable | 9 from mercurial.help import helptable |
10 | 10 |
11 def get_desc(docstr): | 11 def get_desc(docstr): |
12 if not docstr: | 12 if not docstr: |
13 return "", "" | 13 return "", "" |
100 if d['aliases']: | 100 if d['aliases']: |
101 ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) | 101 ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) |
102 | 102 |
103 # print topics | 103 # print topics |
104 for names, section, doc in helptable: | 104 for names, section, doc in helptable: |
105 underlined(gettext(section).upper()) | 105 underlined(section.upper()) |
106 if callable(doc): | 106 if callable(doc): |
107 doc = doc() | 107 doc = doc() |
108 else: | |
109 doc = gettext(doc) | |
110 ui.write(doc) | 108 ui.write(doc) |
111 ui.write("\n") | 109 ui.write("\n") |
112 | 110 |
113 if __name__ == "__main__": | 111 if __name__ == "__main__": |
114 show_doc(sys.stdout) | 112 show_doc(sys.stdout) |