equal
deleted
inserted
replaced
1 from __future__ import absolute_import |
1 from __future__ import absolute_import |
2 |
2 |
3 from .i18n import _ |
3 from .i18n import _ |
4 from . import ( |
4 from . import ( |
|
5 registrar, |
5 templatekw, |
6 templatekw, |
6 util, |
7 util, |
7 ) |
8 ) |
8 |
9 |
9 def tolist(val): |
10 def tolist(val): |
85 else: |
86 else: |
86 self._names[namespace.name] = namespace |
87 self._names[namespace.name] = namespace |
87 |
88 |
88 # we only generate a template keyword if one does not already exist |
89 # we only generate a template keyword if one does not already exist |
89 if namespace.name not in templatekw.keywords: |
90 if namespace.name not in templatekw.keywords: |
|
91 templatekeyword = registrar.templatekeyword(templatekw.keywords) |
|
92 @templatekeyword(namespace.name) |
90 def generatekw(**args): |
93 def generatekw(**args): |
91 return templatekw.shownames(namespace.name, **args) |
94 return templatekw.shownames(namespace.name, **args) |
92 |
|
93 templatekw.keywords[namespace.name] = generatekw |
|
94 |
95 |
95 def singlenode(self, repo, name): |
96 def singlenode(self, repo, name): |
96 """ |
97 """ |
97 Return the 'best' node for the given name. Best means the first node |
98 Return the 'best' node for the given name. Best means the first node |
98 in the first nonempty list returned by a name-to-nodes mapping function |
99 in the first nonempty list returned by a name-to-nodes mapping function |