comparison doc/gendoc.py @ 21793:e0b29a0c36c4

gendoc: restore use of callable() since it was readded in Python 3.2
author Augie Fackler <raf@durin42.com>
date Mon, 23 Jun 2014 09:23:57 -0400
parents 401f9b661a2d
children 7e8e3c0920a6
comparison
equal deleted inserted replaced
21792:e15c991fe2ec 21793:e0b29a0c36c4
12 from mercurial import minirst 12 from mercurial import minirst
13 from mercurial.commands import table, globalopts 13 from mercurial.commands import table, globalopts
14 from mercurial.i18n import gettext, _ 14 from mercurial.i18n import gettext, _
15 from mercurial.help import helptable, loaddoc 15 from mercurial.help import helptable, loaddoc
16 from mercurial import extensions 16 from mercurial import extensions
17 from mercurial import util
18 17
19 def get_desc(docstr): 18 def get_desc(docstr):
20 if not docstr: 19 if not docstr:
21 return "", "" 20 return "", ""
22 # sanitize 21 # sanitize
135 for name in names: 134 for name in names:
136 ui.write(".. _%s:\n" % name) 135 ui.write(".. _%s:\n" % name)
137 ui.write("\n") 136 ui.write("\n")
138 if sectionfunc: 137 if sectionfunc:
139 ui.write(sectionfunc(sec)) 138 ui.write(sectionfunc(sec))
140 if util.safehasattr(doc, '__call__'): 139 if callable(doc):
141 doc = doc() 140 doc = doc()
142 ui.write(doc) 141 ui.write(doc)
143 ui.write("\n") 142 ui.write("\n")
144 143
145 def commandprinter(ui, cmdtable, sectionfunc): 144 def commandprinter(ui, cmdtable, sectionfunc):