
    wdf                     b    d Z ddlmZ 	 eZn# e$ r eZeZY nw xY w G d dej                  ZdS )a  
This file is part of Dominate.

Dominate is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

Dominate is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General
Public License along with Dominate.  If not, see
<http://www.gnu.org/licenses/>.
   )tagsc                   f     e Zd ZdZd fd	Zd Zd Z eee          Zd Z	 fd	Z
e
xZZd
 Z xZS )documenthtmlDominate<!DOCTYPE html>Nc                    t          t          |                                            || _        t          t          |                               t          j                              | _        t          t          |                               t          j                              | _        | j                            t          j        |                    | _	        | j        | _
        dS )zg
    Creates a new document instance. Accepts `title`, `doctype`, and `request` keyword arguments.
    N)superr   __init__doctypeaddr   headbodytitle
title_node_entry)selfr   r   request	__class__s       V/var/www/book.euthymeo.com/html/venv/lib/python3.11/site-packages/dominate/document.pyr   zdocument.__init__   s     
(D""$$$DLHd++//	<<DIHd++//	<<DIimmDJu$5$566DOiDKKK    c                     | j         j        S N)r   textr   s    r   	get_titlezdocument.get_title(   s    ?r   c                     t          |t                    r|| j        _        d S | j                            | j                   | j                            |           || _        d S r   )
isinstance
basestringr   r   r   remover   )r   r   s     r   	set_titlezdocument.set_title+   s[    %$$ "do
it'''
immEdooor   c                       | j         j        | S )z?
    Adding tags to a document appends them to the <body>.
    )r   r   )r   argss     r   r   zdocument.add5   s     4;?D!!r   c                    g }| j         r/|                    | j                    |                    d           |                     t          t          |           j        |i |           d                    |          S )zT
    Creates a <title> tag if not present and renders the DOCTYPE and tag tree.
    
 )r   appendr
   r   renderjoin)r   r#   kwargsrr   s       r   r(   zdocument.render;   sx     	A | hht|hhtnnnHH)U8T"")4:6::;;;88A;;r   c                     d| j         z  S )Nz<dominate.document "%s">)r   r   s    r   __repr__zdocument.__repr__J   s    %
22r   )r   r   N)__name__
__module____qualname__tagnamer   r   r!   propertyr   r   r(   __str____unicode__r-   __classcell__)r   s   @r   r   r      s        '	  	  	  	  	  	         (9i
(
(%" " "     ! 'K3 3 3 3 3 3 3r   r   N)	__license__r&   r   r   	NameErrorstrunicoder   r    r   r   <module>r;      s   $      **   *'''03 03 03 03 03ty 03 03 03 03 03s    	