Commit 5cced79c by Michael DeHaan

Allow variables to be used raw in with_nested

parent fbea88b9
...@@ -42,11 +42,21 @@ class LookupModule(object): ...@@ -42,11 +42,21 @@ class LookupModule(object):
def __init__(self, basedir=None, **kwargs): def __init__(self, basedir=None, **kwargs):
self.basedir = basedir self.basedir = basedir
def __lookup_injects(self, terms, inject):
results = []
for x in terms:
if isinstance(x, basestring) and x in inject:
results.append(inject[x])
else:
results.append(x)
return results
def run(self, terms, inject=None, **kwargs): def run(self, terms, inject=None, **kwargs):
# this code is common with 'items.py' consider moving to utils if we need it again # this code is common with 'items.py' consider moving to utils if we need it again
terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject) terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject)
terms = self.__lookup_injects(terms, inject)
my_list = terms[:] my_list = terms[:]
my_list.reverse() my_list.reverse()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment