Mercurial > hg
comparison i18n/hggettext @ 45763:bea8cf87bef3 stable
py3: hggettext
`itervalues()` is only available on Python 2. Since this script
doesn't currently refer to the main Mercurial modules, and as a result
doesn't have easy access to the `pycompat` module, I simply changed it
to use `value()` instead. Although this allocates a list on Python 2,
I'd consider that acceptable for a utility script; Mercurial doesn't
have all _that_ many commands anyway.
Differential Revision: https://phab.mercurial-scm.org/D9259
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Thu, 29 Oct 2020 11:11:54 +0100 |
parents | 47ef023d0165 |
children | c102b704edb5 |
comparison
equal
deleted
inserted
replaced
45762:0599c83cdf5c | 45763:bea8cf87bef3 |
---|---|
121 | 121 |
122 cmdtable = getattr(mod, 'cmdtable', {}) | 122 cmdtable = getattr(mod, 'cmdtable', {}) |
123 if not cmdtable: | 123 if not cmdtable: |
124 # Maybe we are processing mercurial.commands? | 124 # Maybe we are processing mercurial.commands? |
125 cmdtable = getattr(mod, 'table', {}) | 125 cmdtable = getattr(mod, 'table', {}) |
126 functions.extend((c[0], False) for c in cmdtable.itervalues()) | 126 functions.extend((c[0], False) for c in cmdtable.values()) |
127 | 127 |
128 for func, rstrip in functions: | 128 for func, rstrip in functions: |
129 if func.__doc__: | 129 if func.__doc__: |
130 docobj = func # this might be a proxy to provide formatted doc | 130 docobj = func # this might be a proxy to provide formatted doc |
131 func = getattr(func, '_origfunc', func) | 131 func = getattr(func, '_origfunc', func) |