관리-도구
편집 파일: formfill.cpython-37.pyc
B )�2Y�% � @ sx d dl mZmZ d dlmZmZ d dlmZmZmZm Z d dlm Z d dlZye W n e k rl eZY nX dddd d dgZG dd� de�Zed deid�Zed�dd� dD ��deid�Zeddeid�Zed�Zd2dd�Zd3dd�Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd4d$d%�Zd&d'� Z G d(d� de!�Z"e"� Z#ddd)e#fd*d �Z$d+d � Z%d,d-� Z&d.d/� Z'd0d1� Z(dS )5� )�XPath�ElementBase)� fromstring�XHTML_NAMESPACE)�_forms_xpath�_options_xpath�_nons�_transform_result)�defsN�FormNotFound� fill_form�fill_form_html� insert_errors�insert_errors_html�DefaultErrorCreatorc @ s e Zd ZdZdS )r z* Raised when no form can be found N)�__name__� __module__�__qualname__�__doc__� r r �E/opt/alt/python37/lib64/python3.7/site-packages/lxml/html/formfill.pyr s zKdescendant-or-self::form[name=$name]|descendant-or-self::x:form[name=$name]�x)Z namespaces�|c C s g | ]}d | �qS )zdescendant-or-self::r )�.0Z_tagr r r � <listcomp> s r )�input�select�textareazx:inputzx:selectz x:textareaz-//label[@for=$for_id]|//x:label[@for=$for_id]z"descendant-or-self::*[@name=$name]c C s t | ||d�} t| |� d S )N)�form_id� form_index)� _find_form� _fill_form)�el�valuesr r r r r r s c C s@ t | �}t| t�rt| �}n t�| �}t||||d� t||�S )N)r r )�type� isinstance� basestringr �copy�deepcopyr r )�htmlr# r r �result_type�docr r r r &