mò öÑ8Oc@sKdZdZdkZdkZdkZdkZdkZdklZl Z dkl Z dk l Z dk lZlZdefd„ƒYZd efd „ƒYZd fd „ƒYZd e fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zd„Zd„Zde fd„ƒYZd„Zd„Zd„Zdd„Zd„Z d„Z!dd „Z"d!„Z#d"„Z$d#„Z%d$„Z&e'd%„Z(d&„Z)d'„Z*d(„Z+hd)d*<d+d*<d,d-<d.d-<d/d-<d0d-     "  DcOs(|io|i|i||ŽSndS(sÁ Level-0, "DEBUG": an internal reporting issue. Typically, there is no effect on the processing. Level-0 system messages are handled separately from the others. N(RRRR:targsR-(RR=R-((RRÆs cOs|i|i||ŽS(s§ Level-1, "INFO": a minor issue that can be ignored. Typically there is no effect on processing, and level-1 system messages are not reported. N(RRt INFO_LEVELR=R-(RR=R-((RtinfoÏscOs|i|i||ŽS(s‘ Level-2, "WARNING": an issue that should be addressed. If ignored, there may be unpredictable problems with the output. N(RRt WARNING_LEVELR=R-(RR=R-((RtwarningÖscOs|i|i||ŽS(sz Level-3, "ERROR": an error that should be addressed. If ignored, the output will contain errors. N(RRt ERROR_LEVELR=R-(RR=R-((RterrorÝscOs|i|i||ŽS(sâ Level-4, "SEVERE": a severe error that must be addressed. If ignored, the output will contain severe errors. Typically level-4 system messages are turned into exceptions which halt processing. N(RRt SEVERE_LEVELR=R-(RR=R-((Rtsevereäs(R R t__doc__tsplitR7trangeR:R>R@RBRDR1tFalseRR!R$R&R(RRR?RARCRE(((RR !s  3    /   tExtensionOptionErrorcBstZRS(N(R R (((RRJístBadOptionErrorcBstZRS(N(R R (((RRKîstBadOptionDataErrorcBstZRS(N(R R (((RRLïstDuplicateOptionErrorcBstZRS(N(R R (((RRMðscCst|ƒ}t||ƒ}|S(sC Return a dictionary mapping extension option names to converted values. :Parameters: - `field_list`: A flat field list without field arguments, where each field body consists of a single paragraph only. - `options_spec`: Dictionary mapping known option names to a conversion function such as `int` or `float`. :Exceptions: - `KeyError` for unknown option names. - `ValueError` for invalid option values (raised by the conversion function). - `TypeError` for invalid option value types (raised by conversion function). - `DuplicateOptionError` for duplicate options. - `BadOptionError` for invalid fields. - `BadOptionDataError` for invalid option data (missing name, missing data, bad quotes, etc.). N(textract_optionst field_listt option_listtassemble_option_dictt options_spect option_dict(RORRRSRP((Rtextract_extension_optionsós cCs*g}x|D]}t|diƒiƒƒdjotdƒ‚nt|diƒiƒƒ}|d}t|ƒdjo d}n‡t|ƒdjpKt |dtiƒ p3t|dƒdjpt |ddtiƒ otd|ƒ‚n|ddiƒ}|i||fƒq W|S(s¤ Return a list of option (name, value) pairs from field names & bodies. :Parameter: `field_list`: A flat field list, where each field name is a single word and each field body consists of a single paragraph only. :Exceptions: - `BadOptionError` for invalid fields. - `BadOptionDataError` for invalid option data (missing name, missing data, bad quotes, etc.). iis:extension option field name may not contain multiple wordssMextension option field body may contain a single paragraph only (option "%s")N(RPROtfieldtlenRRGRKtstrtlowertnametbodyR1tdataRR6t paragraphtTextRLR"(RORZRYRURPR[((RRN s #  ^cCsÃh}x¶|D]®\}}||}|djot|ƒ‚n||jotd|ƒ‚ny||ƒ||>> find_combining_chars(u'A t̆ab̆lĕ') [3, 6, 9] iiN(ii( RRµRWRnR¼R¨t enumeratetiR½R¾R¿(RµR¨R½RÂ((Rtfind_combining_charsAs cCsctt|ƒƒ}xt|ƒD]}d||q>~S(s�Indices of Unicode string `text` when skipping combining characters. >>> column_indices(u'A t̆ab̆lĕ') [0, 1, 2, 4, 5, 7, 8] N( RHRVRµtstring_indicesRÃtindexR1R¨RÂ(RµRÅRÂR¨RÄ((Rtcolumn_indicesKs  tWitFtNaitHtNtAcCs¢t|tƒotidjot|ƒSny8tg}|D]}|t t i |ƒq?~ƒ}Wnt j ot|ƒ}nX|tt|ƒƒ8}|S(sqReturn the column width of text. Correct ``len(text)`` for wide East Asian and combining Unicode chars. iiN(ii(RRµRWRnR¼RVtsumR¨R½teast_asian_widthsR¾teast_asian_widthtwidthR5RÃ(RµR¨R½RÐ((Rt column_widthbs 8cCs9g}x,|D]$}||jo|i|ƒq q W|S(N(trtLtitemR"(RÓRÔRÒ((Rtuniqrs  ccss|djogVn[xWtt|ƒ|dƒD];}x2t||d|dƒD]}||g|VqRWq0WdS(s=Return n-length tuples, in sorted order, no repeated elementsiiN(tntxrangeRVtitemsRÂtunique_combinationstcc(RØRÖRÂRÚ((RRÙ{s cCs©|iƒiddƒ}g}|idƒd }|idƒd}xTtt|ƒddƒD]:}x1t ||ƒD] }|i di ||ƒƒqsWq]W||7}|S(s·Return a list of normalized combinations for a `BCP 47` language tag. Example: >>> normalize_language_tag('de-AT-1901') ['de_at_1901', 'de_at', 'de_1901', 'de'] t-t_iiiÿÿÿÿN(ttagRXRjttaglistRGtbase_tagtsubtagsRHRVRÖRÙttagsR"Rg(RÝRßRáRàRÖRÞ((Rtnormalize_language_tagƒs" tDependencyListcBsAtZdZegd„Zd„Zd„Zd„Zd„ZRS(s­ List of dependencies, with file recording support. Note that the output file is not automatically closed. You have to explicitly call the close() method. cCs/|i|ƒx|D]}|i|ƒqWdS(s³ Initialize the dependency list, automatically setting the output file to `output_file` (see `set_output()`) and adding all supplied dependencies. N(Rt set_outputt output_filet dependenciesRÂtadd(RRåRæRÂ((RR£s  cCs\g|_|o?|djo d}n|}td|dddtƒ|_n d|_dS(sH Set the output file and clear the list of already added dependencies. `output_file` must be a string. The specified file is immediately overwritten. If output_file is '-', the output will be written to stdout. If it is None, no file output is done when calling add(). RÛtdestination_pathRtutf8t autocloseN(RtlistRåR1toft FileOutputRItfile(RRåRì((RRä­s     cGsaxZ|D]R}||ijo<|ii|ƒ|idj o|ii|dƒqYqqWdS(s¥ If the dependency `filename` has not already been added, append it to self.list and print it to self.file if self.file is not None. s N(t filenamestfilenameRRëR"RîR1R;(RRïRð((RRçÃscCs|iiƒd|_dS(s( Close the output file. N(RRîtcloseR1(R((RRñÏs cCsFy|ii}Wntj o d}nXd|ii||ifS(Ns %s(%r, %s)( RRîRYRåR5R1RfR Rë(RRå((Rt__repr__Ös  ( R R RFR1RRäRçRñRò(((RRãšs   (3RFt __docformat__RnR–tos.pathRR¾R…tApplicationErrort DataErrorR6t docutils.ioRítdocutils.error_reportingRR,RR R RJRKRLRMRTRNRQRhRrR}R„R1R‹R“RŸR¥RªR¯R0R·RIR»RÀRÃRÆRÎRÑRÕRÙRâtobjectRã(+R¥RÎR0RóRTRÆRrRªRÙRãRÕRÃR R,RQR}RRJR‹RâRöRRõR·RÀRíRnRŸRMRÑR“R6R¾R»R„RKR–R¯RRNRLR Rh((Rt?sV       Ì  !  ,        <