def get_template_path_with_theme(relative_path):
 relative_path = os.path.normpath(relative_path)
 theme = get_current_theme()
 if (not theme):
  return relative_path
 template_name = re.sub('^/+', '', relative_path)
 template_path = (theme.template_path / template_name)
 absolute_path = ((theme.path / 'templates') / template_name)
 if absolute_path.exists():
  return str(template_path)
 else:
  return relative_path

def get_template_path_with_theme ( relative_path ) : relative_path = os . path . normpath ( relative_path ) theme = get_current_theme ( ) if ( not theme ) : return relative_path template_name = re . sub ( '^/+' , '' , relative_path ) template_path = ( theme . template_path / template_name ) absolute_path = ( ( theme . path / 'templates' ) / template_name ) if absolute_path . exists ( ) : return str ( template_path ) else : return relative_path
returns template path in current sites theme if it finds one there otherwise returns same path .