File: //lib/python3/dist-packages/mercurial/hgweb/__pycache__/hgweb_mod.cpython-310.pyc
o
�]LbG � @ s� d dl mZ d dlZd dlZddlmZmZmZmZm Z ddl
mZ ddlm
Z
mZmZmZmZmZmZm
Z
mZmZmZmZmZmZmZmZ ddlmZmZm Z m!Z! d d
� Z"ddd�Z#ddd�Z$G dd� de%�Z&G dd� de%�Z'dd� Z(dS )� )�absolute_importN� )�
ErrorResponse�HTTP_BAD_REQUEST� cspvalues� permhooks�
statusmessage� )�getattr)�encoding�error�
extensions� formatter�hg�hook� profiling�pycompat� registrar�repoview�templatefilters� templater�templateutil�ui�util�wireprotoserver)�request�webcommands�webutil�wsgicgic C s( | j �dd �|dd�df}|t||�fS )N� style� webs paper)�qsparams�get� _stylemap)�req�configfn�templatepath�styles� r( �;/usr/lib/python3/dist-packages/mercurial/hgweb/hgweb_mod.py�getstyle2 s
�r* c C s� | D ]>}|r|t jt jfv st j|v st jrt j|v rqtj�|d�d| df}|D ]}t� ||�\}}|r?|||f S q*qt
d| ��)z�Return path to mapfile for a given style.
Searches mapfile in the following locations:
1. templatepath/style/map
2. templatepath/map-style
3. templatepath/map
s maps map-s No hgweb templates found in %r)r �oscurdir�ospardir�ossep�osaltsep�os�path�joinr �try_open_template�RuntimeError)r'