o
    ~¨Êhð  ã                   @   sX   d dl mZ d dlmZ d dlmZ d dlmZ G dd„ dej	ƒZ
G dd„ dej	ƒZd	S )
é    )ÚSite)Úmodels)Úget_text_list)Úgettext_lazyc                       sN   e Zd ZdZejedƒdedƒd�ZG dd„ dƒZdd	„ Z	‡ fd
d„Z
‡  ZS )ÚUrlz˜
    Defines a URL pattern for use with a robot exclusion rule. It's
    case-sensitive and exact, e.g., "/admin" and "/admin/" are different URLs.
    Úpatternéÿ   a  Case-sensitive. A missing trailing slash does also match to files which start with the name of the pattern, e.g., '/admin' matches /admin.html too. Some major search engines allow an asterisk (*) as a wildcard and a dollar sign ($) to match the end of the URL, e.g., '/*.jpg$'.©Ú
max_lengthÚ	help_textc                   @   s   e Zd ZedƒZedƒZdS )zUrl.MetaÚurlN©Ú__name__Ú
__module__Ú__qualname__Ú_Úverbose_nameÚverbose_name_plural© r   r   ú?/var/www/html/env/lib/python3.10/site-packages/robots/models.pyÚMeta   ó    r   c                 C   ó
   d| j  S ©Nz%s)r   ©Úselfr   r   r   Ú__str__   ó   
zUrl.__str__c                    s.   | j  d¡sd| j  | _ tƒ j|i |¤Ž d S )Nú/)r   Ú
startswithÚsuperÚsave)r   ÚargsÚkwargs©Ú	__class__r   r   r!   !   s   zUrl.save)r   r   r   Ú__doc__r   Ú	CharFieldr   r   r   r   r!   Ú__classcell__r   r   r$   r   r      s    ÿýr   c                   @   sÊ   e Zd ZdZejedƒdedƒd�Zeje	ddedƒedƒd	�Z
eje	dd
ed
ƒedƒd	�Zejeedƒd�Zejedƒddddedƒd�ZG dd„ dƒZdd„ Zdd„ Zedƒe_dd„ Zed
ƒe_dS )ÚRulea7  
    Defines an abstract rule which is used to respond to crawling web robots,
    using the robot exclusion standard, a.k.a. robots.txt. It allows or
    disallows the robot identified by its user agent to access the given URLs.
    The Site contrib app is used to enable multiple robots.txt per instance.
    Úrobotr   zÑThis should be a user agent string like 'Googlebot'. Enter an asterisk (*) for all user agents. For a full list look at the <a target=_blank href='http://www.robotstxt.org/db.html'> database of Web Robots</a>.r	   TÚallowedz2The URLs which are allowed to be accessed by bots.)ÚblankÚrelated_namer   r   Ú
disallowedz6The URLs which are not allowed to be accessed by bots.Úsites)r   zcrawl delayé   é   aû  Between 0.1 and 99.0. This field is supported by some search engines and defines the delay between successive crawler accesses in seconds. If the crawler rate is a problem for your server, you can set the delay up to 5 or 10 or a comfortable value for your server, but it's suggested to start with small values (0.5-1), and increase as needed to an acceptable value for your server. Larger delay values add more delay between successive crawl accesses and decrease the maximum crawl rate to your web server.)r,   ÚnullÚ
max_digitsÚdecimal_placesr   c                   @   s   e Zd ZedƒZedƒZdS )z	Rule.MetaÚruleÚrulesNr   r   r   r   r   r   f   r   r   c                 C   r   r   )r*   r   r   r   r   r   j   r   zRule.__str__c                 C   ó   t t| j ¡ ƒtdƒƒS ©NÚand)r   Úlistr+   Úallr   r   r   r   r   Úallowed_urlsm   ó   zRule.allowed_urlsc                 C   r7   r8   )r   r:   r.   r;   r   r   r   r   r   Údisallowed_urlsr   r=   zRule.disallowed_urlsN)r   r   r   r&   r   r'   r   r*   ÚManyToManyFieldr   r+   r.   r   r/   ÚDecimalFieldÚcrawl_delayr   r   r<   Úshort_descriptionr>   r   r   r   r   r)   '   sP    ÿýûûÿú
r)   N)Údjango.contrib.sites.modelsr   Ú	django.dbr   Údjango.utils.textr   Údjango.utils.translationr   r   ÚModelr   r)   r   r   r   r   Ú<module>   s     