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¬ d Z ddlZddlmZmZmZmZ ddlmZ dZ dj
e d�ZG d d
„ d
ƒZedƒZ
eeeedf eeeef dœd
d„Zeeeeeef eeeef ee f ZdS )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¢ e Zd ZdZeed ef ddœdd„Zee e
dœdd„ƒZed œd
d„Zed œdd
„Z
ed œdd„Zeeeeef dœdd„Ze e
dœdd„Zd d dœ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Úreturnc C s¬ t |tƒr|| _dS t |tƒr,|jƒ | _dS t |tƒo@tjt|ƒ}|sPt |ƒ‚nX|j
dƒrŠt|j
dƒƒ}|d krx|d nd}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é r c S s g | ]}|rt |ƒnd ‘qS )N)r )Ú.0Úg© r ú2/tmp/pip-build-vnmlutbd/PyPDF2/PyPDF2/pagerange.pyú
M s z&PageRange.__init__..é é é éÿÿÿÿ)Ú
isinstanceÚsliceÚ_slicer Úto_sliceÚstrÚreÚmatchÚ
PAGE_RANGE_REr Úgroupr )Úselfr
ÚmÚstartÚstopr r r Ú__init__% s
zPageRange.__init__)Úinputr c C s( t | ttfƒp&t