Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ©«jã@s¬dZddlZddlmZmZmZmZddlmZdZ dj e d�Z Gd d „d ƒZ e d ƒZ eeee dfeeee fd œd d„Zeee eeefeeeefeefZdS)z÷ Representation and utils for ranges of PDF file pages. Copyright (c) 2014, Steve Witham . All rights reserved. This software is available under a BSD license; see https://github.com/py-pdf/PyPDF2/blob/main/LICENSE éN)ÚAnyÚListÚTupleÚUnioné)Ú ParseErrorz(0|-?[1-9]\d*)z%^({int}|({int}?(:{int}?(:{int}?)?)))$)Úintc@s¢eZdZdZeedefddœdd„Zee e dœdd„ƒZ ed œd d „Z ed œd d „Z ed œdd„Zeeeeefdœdd„Ze e dœdd„Zdddœdd„ZdS)Ú PageRangeaK A slice-like representation of a range of page indices. For example, page numbers, only starting at zero. The syntax is like what you would put between brackets [ ]. The slice is one of the few Python types that can't be subclassed, but this class converts to and from slices, and allows similar use. - PageRange(str) parses a string representing a page range. - PageRange(slice) directly "imports" a slice. - to_slice() gives the equivalent slice. - str() and repr() allow printing. - indices(n) is like slice.indices(n). N)ÚargÚreturncCs¬t|tƒr||_dSt|tƒr,|jƒ|_dSt|tƒo@tjt|ƒ}|sPt |ƒ‚nX|j dƒrŠt |j dƒƒ}|d krx|dnd}t||ƒ|_ntdd„|j dddƒDƒŽ|_dS) aÒ Initialize with either a slice -- giving the equivalent page range, or a PageRange object -- making a copy, or a string like "int", "[int]:[int]" or "[int]:[int]:[int]", where the brackets indicate optional ints. Remember, page indices start with zero. Page range expression examples: : all pages. -1 last page. 22 just the 23rd page. :-1 all but the last page. 0:3 the first three pages. -2 second-to-last page. :3 the first three pages. -2: last two pages. 5: from the sixth page onward. -3:-1 third & second to last. The third, "stride" or "step" number is also recognized. ::2 0 2 4 ... to the end. 3:0:-1 3 2 1 but not 0. 1:10:2 1 3 5 7 9 2::-1 2 1 0. ::-1 all pages in reverse order. Note the difference between this notation and arguments to slice(): slice(3) means the first three pages; PageRange("3") means the range of only the fourth page. However PageRange(slice(3)) means the first three pages. NércSsg|]}|rt|ƒnd‘qS)N)r)Ú.0Úg©rú2/tmp/pip-build-vnmlutbd/PyPDF2/PyPDF2/pagerange.pyú Msz&PageRange.__init__..ééééÿÿÿÿ) Ú isinstanceÚsliceÚ_slicer Úto_sliceÚstrÚreÚmatchÚ PAGE_RANGE_RErÚgroupr)Úselfr ÚmÚstartÚstoprrrÚ__init__%s     zPageRange.__init__)Úinputr cCs(t|ttfƒp&t|tƒo&ttjt|ƒƒS)z5True if input is a valid initializer for a PageRange.)rrr rÚboolrrr)r$rrrÚvalidOszPageRange.valid)r cCs|jS)z/Return the slice equivalent of this page range.)r)rrrrrVszPageRange.to_slicecCsf|j}|jdkrB|jdk r4|j|jdkr4t|jƒS|j|jf}n|j|j|jf}djdd„|DƒƒS)zA string like "1:2:3".Nrú:css"|]}|dkrdnt|ƒVqdS)NÚ)r)r Úirrrú esz$PageRange.__str__..)rÚstepr!r"rÚjoin)rÚsÚindicesrrrÚ__str__Zs  zPageRange.__str__cCsdtt|ƒƒdS)z#A string like "PageRange('1:2:3')".z PageRange(ú))Úreprr)rrrrÚ__repr__gszPageRange.__repr__)Únr cCs |jj|ƒS)zˆ n is the length of the list of pages to choose from. Returns arguments for range(). See help(slice.indices). )rr.)rr3rrrr.kszPageRange.indices)Úotherr cCst|tƒsdS|j|jkS)NF)rr r)rr4rrrÚ__eq__ss zPageRange.__eq__cCs®t|tƒstdt|ƒ›�ƒ‚|jjdk s4|jjdk rs  w