|
|
@@ -266,8 +266,12 @@ class Refer(Extension): |
|
|
|
includeNode.template = template |
|
|
|
|
|
|
|
return [ |
|
|
|
nodes.Assign(nodes.Name(MARKINGS, 'store'), nodes.Const({})).set_lineno(lineno), |
|
|
|
nodes.Assign(nodes.Name(namespace, 'store'), nodes.Const({})).set_lineno(lineno), |
|
|
|
nodes.Assign( |
|
|
|
nodes.Name(MARKINGS, 'store'), |
|
|
|
nodes.Const({})).set_lineno(lineno), |
|
|
|
nodes.Assign( |
|
|
|
nodes.Name(namespace, 'store'), |
|
|
|
nodes.Const({})).set_lineno(lineno), |
|
|
|
nodes.CallBlock( |
|
|
|
self.call_method('_push_resource', |
|
|
|
args=[ |
|
|
@@ -276,8 +280,11 @@ class Refer(Extension): |
|
|
|
nodes.Name('resource', 'load'), |
|
|
|
template]), |
|
|
|
[], [], []).set_lineno(lineno), |
|
|
|
nodes.Assign(nodes.Name('resource', 'store'), |
|
|
|
nodes.Getitem(nodes.Name(namespace, 'load'), nodes.Const('current_resource'), 'load')).set_lineno(lineno), |
|
|
|
nodes.Assign( |
|
|
|
nodes.Name('resource', 'store'), |
|
|
|
nodes.Getitem(nodes.Name(namespace, 'load'), |
|
|
|
nodes.Const('resource'), 'load') |
|
|
|
).set_lineno(lineno), |
|
|
|
nodes.CallBlock( |
|
|
|
self.call_method('_assign_reference', |
|
|
|
args=[ |
|
|
@@ -285,12 +292,14 @@ class Refer(Extension): |
|
|
|
nodes.Name(namespace, 'load')]), |
|
|
|
[], [], [includeNode]).set_lineno(lineno), |
|
|
|
nodes.Assign(nodes.Name('resource', 'store'), |
|
|
|
nodes.Getitem(nodes.Name(namespace, 'load'), nodes.Const('parent_resource'), 'load')).set_lineno(lineno), |
|
|
|
nodes.Getitem(nodes.Name(namespace, 'load'), |
|
|
|
nodes.Const('parent_resource'), 'load') |
|
|
|
).set_lineno(lineno), |
|
|
|
] |
|
|
|
|
|
|
|
def _push_resource(self, namespace, site, resource, template, caller): |
|
|
|
namespace['parent_resource'] = resource |
|
|
|
namespace['current_resource'] = site.content.resource_from_relative_path(template) |
|
|
|
namespace['resource'] = site.content.resource_from_relative_path(template) |
|
|
|
return '' |
|
|
|
|
|
|
|
def _assign_reference(self, markings, namespace, caller): |
|
|
|