def construct_relative_path(current_template_name, relative_name):
 if (not any((relative_name.startswith(x) for x in ["'./", "'../", '"./', '"../']))):
  return relative_name
 new_name = posixpath.normpath(posixpath.join(posixpath.dirname(current_template_name.lstrip('/')), relative_name.strip('\'"')))
 if new_name.startswith('../'):
  raise TemplateSyntaxError(("The relative path '%s' points outside the file hierarchy that template '%s' is in." % (relative_name, current_template_name)))
 if (current_template_name.lstrip('/') == new_name):
  raise TemplateSyntaxError(("The relative path '%s' was translated to template name '%s', the same template in which the tag appears." % (relative_name, current_template_name)))
 return ('"%s"' % new_name)

def construct_relative_path ( current_template_name , relative_name ) : if ( not any ( ( relative_name . startswith ( x ) for x in [ "'./" , "'../" , '"./' , '"../' ] ) ) ) : return relative_name new_name = posixpath . normpath ( posixpath . join ( posixpath . dirname ( current_template_name . lstrip ( '/' ) ) , relative_name . strip ( '\'"' ) ) ) if new_name . startswith ( '../' ) : raise TemplateSyntaxError ( ( "The relative path '%s' points outside the file hierarchy that template '%s' is in." % ( relative_name , current_template_name ) ) ) if ( current_template_name . lstrip ( '/' ) == new_name ) : raise TemplateSyntaxError ( ( "The relative path '%s' was translated to template name '%s', the same template in which the tag appears." % ( relative_name , current_template_name ) ) ) return ( '"%s"' % new_name )
convert a relative path to the full template name based on the current_template_name .