Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
#6] @ s d Z dZddlZddlmZ ddlmZ ddlZddlmZm Z ddl
mZ ddlZddl
Z
ddlZddlZddlZddlZddlZddlZdd Zd#ddZG d
d deZdd ZdZdZd$ddZd%ddZd&ddZd'ddZd(d d!Zed"kreejj dS ))z=Diagnostic functions, mainly for use when doing tech support.ZMIT N)StringIO)
HTMLParser)
BeautifulSoup__version__)builder_registryc ; C sX t dt t dtj dddg}x>|D ]6}x0tjD ]}||jkr6P q6W |j| t d| q*W d|kr|jd y*dd l m
} t d
djtt
|j W n* tk
r } zt d W Y d
d
}~X nX d|krydd
l}t d|j W n, tk
r } zt d W Y d
d
}~X nX t| dr4| j } n| jdsL| jdrdt d| t d d
S y:tjj| rt d| t| }|j } W d
Q R X W n tk
r Y nX t x|D ]}t d| d} yt| |d}
d} W n8 tk
r" } zt d| tj W Y d
d
}~X nX | rBt d| t |
j t dd qW d
S )z/Diagnostic suite for isolating common problems.z'Diagnostic running on Beautiful Soup %szPython version %szhtml.parserhtml5liblxmlz;I noticed that %s is not installed. Installing it may help.zlxml-xmlr )etreezFound lxml version %s.z.lxml is not installed or couldn't be imported.NzFound html5lib version %sz2html5lib is not installed or couldn't be imported.readzhttp:zhttps:z<"%s" looks like a URL. Beautiful Soup is not an HTTP client.zpYou need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.z7"%s" looks like a filename. Reading data from the file.z#Trying to parse your markup with %sF)featuresTz%s could not parse the markup.z#Here's what %s did with the markup:-P )printr sysversionr Zbuildersr removeappendr r joinmapstrZLXML_VERSIONImportErrorr hasattrr
startswithospathexistsopen
ValueErrorr Exception traceback print_excZprettify)dataZ
basic_parsersnameZbuilderr er fpparsersuccesssoup r) /usr/lib/python3.6/diagnose.pydiagnose sj
r+ Tc K sN ddl m} x<|jt| fd|i|D ]\}}td||j|jf q(W dS )zPrint out the lxml events that occur during parsing.
This lets you see how lxml parses a document when no Beautiful
Soup code is running.
r )r htmlz%s, %4s, %sN)r r Z iterparser r tagtext)r" r, kwargsr Zeventelementr) r) r*
lxml_traceZ s $r1 c @ s` e Zd ZdZdd Zdd Zdd Zdd Zd
d Zdd
Z dd Z
dd Zdd Zdd Z
dS )AnnouncingParserz?Announces HTMLParser parse events, without doing anything else.c C s t | d S )N)r )selfsr) r) r* _pg s zAnnouncingParser._pc C s | j d| d S )Nz%s START)r5 )r3 r# Zattrsr) r) r* handle_starttagj s z AnnouncingParser.handle_starttagc C s | j d| d S )Nz%s END)r5 )r3 r# r) r) r*
handle_endtagm s zAnnouncingParser.handle_endtagc C s | j d| d S )Nz%s DATA)r5 )r3 r" r) r) r* handle_datap s zAnnouncingParser.handle_datac C s | j d| d S )Nz
%s CHARREF)r5 )r3 r# r) r) r* handle_charrefs s zAnnouncingParser.handle_charrefc C s | j d| d S )Nz%s ENTITYREF)r5 )r3 r# r) r) r* handle_entityrefv s z!AnnouncingParser.handle_entityrefc C s | j d| d S )Nz
%s COMMENT)r5 )r3 r" r) r) r* handle_commenty s zAnnouncingParser.handle_commentc C s | j d| d S )Nz%s DECL)r5 )r3 r" r) r) r* handle_decl| s zAnnouncingParser.handle_declc C s | j d| d S )Nz%s UNKNOWN-DECL)r5 )r3 r" r) r) r* unknown_decl s zAnnouncingParser.unknown_declc C s | j d| d S )Nz%s PI)r5 )r3 r" r) r) r* handle_pi s zAnnouncingParser.handle_piN)__name__
__module____qualname____doc__r5 r6 r7 r8 r9 r: r; r<