eaiovnaovbqoebvqoeavibavo 3 &6]$@s dZyddlmZWn.ek rBZzddlmZWYddZ[XnXddlZddlZddlZddl Z ddl m Z dZ ej ddkZejdZdd ZGd d d eZGd d d eZGdddeZGdddeZGddde ZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGd d!d!eZGd"d#d#eeZ Gd$d%d%e Z!Gd&d'd'e!Z"Gd(d)d)e!Z#Gd*d+d+e#Z$Gd,d-d-e!Z%Gd.d/d/e!Z&Gd0d1d1e!Z'Gd2d3d3eZ(Gd4d5d5eZ)Gd6d7d7e*Z+dS)8ZMIT)CallableN)EntitySubstitutionzutf-8z\s+cs&tfdd}|jfdd}|S)z>Alias one attribute name to another for backward compatibilitycs t|S)N)getattr)self)attr/usr/lib/python3.6/element.pyaliassz_alias..aliascs t|S)N)setattr)r)rrr r s)propertysetter)rr r)rr _aliassrc@seZdZdddZdS)NamespacedAttributeNcCsV|dkrtj||}n*|dkr,tj||}ntj||d|}||_||_||_|S)N:)str__new__prefixname namespace)clsrrrobjrrr r"szNamespacedAttribute.__new__)N)__name__ __module__ __qualname__rrrrr r src@seZdZdZdS)%AttributeValueWithCharsetSubstitutionz=A stand-in object for a character encoding specified in HTML.N)rrr__doc__rrrr r/src@s eZdZdZddZddZdS)CharsetMetaAttributeValuezA generic stand-in for the value of a meta tag's 'charset' attribute. When Beautiful Soup parses the markup '', the value of the 'charset' attribute will be one of these objects. cCstj||}||_|S)N)rroriginal_value)rrrrrr r9s z!CharsetMetaAttributeValue.__new__cCs|S)Nr)rencodingrrr encode>sz CharsetMetaAttributeValue.encodeN)rrrrrr rrrr r2src@s.eZdZdZejdejZddZddZ dS)ContentMetaAttributeValueaA generic stand-in for the value of a meta tag's 'content' attribute. When Beautiful Soup parses the markup: The value of the 'content' attribute will be one of these objects. z((^|;)\s*charset=)([^;]*)cCs6|jj|}|dkr tjt|Stj||}||_|S)N) CHARSET_REsearchrrr)rrmatchrrrr rMs    z!ContentMetaAttributeValue.__new__csfdd}|jj||jS)Ncs|jdS)N)group)r$)rrr rewriteXsz1ContentMetaAttributeValue.encode..rewrite)r"subr)rrr'r)rr r Ws z ContentMetaAttributeValue.encodeN) rrrrrecompileMr"rr rrrr r!Bs r!c@sVeZdZdZeddgZedgZeddgZeddZ edd Z ed d Z d S) HTMLAwareEntitySubstitutiona%Entity substitution rules that are aware of some HTML quirks. Specifically, the contents of