Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/docutils/__pycache__/io.cpython-37.pyc

249 lines
13 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>[<5B>]C<00>@sdZdZddlZddlZddlZddlZddlmZddlm Z m
Z
m Z Gdd<07>de <0C>Z Gdd <09>d e <0C>Zd
d <0B>ZGd d <0A>d e<07>ZGdd<0F>de<07>ZGdd<11>de<10>ZGdd<13>de<11>ZGdd<15>de<13>ZGdd<17>de<10>ZGdd<19>de<11>ZGdd<1B>de<10>ZGdd<1D>de<11>ZGdd<1F>de<10>ZdS) z
I/O classes provide a uniform API for low-level input and output. Subclasses
exist for a variety of input/output mechanisms.
ZreStructuredText<78>N)<01> TransformSpec)<03>locale_encoding<6E> ErrorString<6E> ErrorOutputc@s eZdZdS)<02>
InputErrorN)<03>__name__<5F>
__module__<EFBFBD> __qualname__<5F>r
r
<00>1/tmp/pip-install-u_6_z2pz/docutils/docutils/io.pyrsrc@s eZdZdS)<02> OutputErrorN)rrr r
r
r
r r sr c
Cs6yt<00>|j<02>t<00>|<01>kStttfk
r0dSXdS)aNTest, whether the encoding of `stream` matches `encoding`.
Returns
:None: if `encoding` or `stream.encoding` are not a valid encoding
argument (e.g. ``None``) or `stream.encoding is missing.
:True: if the encoding argument resolves to the same value as `encoding`,
:False: if the encodings differ.
N)<06>codecs<63>lookup<75>encoding<6E> LookupError<6F>AttributeError<6F> TypeError)<02>streamrr
r
r <00>check_encodings
rc@sheZdZdZdZdZddd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Z e
<EFBFBD> d <0A>Z e jdfe jdfe jdffZdd<12>ZdS)<14>Inputz1
Abstract base class for input wrappers.
<20>inputN<74>strictcCs.||_||_||_||_|s$|j|_d|_dS)N)r<00> error_handler<65>source<63> source_path<74>default_source_path<74>successful_encoding)<05>selfrrrrr
r
r <00>__init__1szInput.__init__cCsd|j|j|jfS)Nz%s: source=%r, source_path=%r)<03> __class__rr)rr
r
r <00>__repr__Es
zInput.__repr__cCst<00>dS)N)<01>NotImplementedError)rr
r
r <00>readIsz
Input.readc Cs<>|jr&|j<00><01>dkr&t|t<03>s&td<02><01>t|t<03>r4|S|jrD|jg}n.|<00>|<01>}|rZ|g}nddg}trr|<02>dt<06>xX|D]P}y t|||j<08>}||_ |<05>
dd<07>St t fk
r<EFBFBD>}z|}Wdd}~XYqxXqxWt d d
<EFBFBD> d d <0C>|D<00><01>t|<07>f<00><01>dS) a
Decode a string, `data`, heuristically.
Raise UnicodeError if unsuccessful.
The client application should call ``locale.setlocale`` at the
beginning of processing::
locale.setlocale(locale.LC_ALL, '')
<20>unicodez=input encoding is "unicode" but input is not a unicode objectzutf-8zlatin-1<>u<>NzEUnable to decode input data. Tried the following encodings: %s.
(%s)z, cSsg|] }t|<01><01>qSr
)<01>repr)<02>.0<EFBFBD>encr
r
r <00>
<listcomp>ysz Input.decode.<locals>.<listcomp>)r<00>lower<65>
isinstance<EFBFBD>str<74>AssertionError<6F>determine_encoding_from_datar<00>insertrr<00>replace<63> UnicodeErrorr<00>joinr)r<00>data<74> encodings<67> data_encodingr(<00>decoded<65>err<72>errorr
r
r <00>decodeLs0
 


 
 z Input.decodescoding[:=]\s*([-\w.]+)zutf-8z utf-16-bez utf-16-lecCs`x |jD]\}}|<01>|<02>r|SqWx8|<01><02>dd<02>D]$}|j<03>|<04>}|r4|<05>d<03><01>d<04>Sq4WdS)z<>
Try to determine the encoding of `data` by looking *in* `data`.
Check for a byte order mark (BOM) or an encoding declaration.
N<>r$<00>ascii)<07>byte_order_marks<6B>
startswith<EFBFBD>
splitlines<EFBFBD> coding_slug<75>search<63>groupr9)rr3Z start_bytesr<00>line<6E>matchr
r
r r.<00>s
 z"Input.determine_encoding_from_data)NNNr)rrr <00>__doc__<5F>component_typerrr r"r9<00>re<72>compiler?r <00>BOM_UTF8<46> BOM_UTF16_BE<42> BOM_UTF16_LEr<r.r
r
r
r r's
0
 rc@s:eZdZdZdZdZd dd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Z dS)<0E>Outputz2
Abstract base class for output wrappers.
<20>outputNrcCs,||_|p d|_||_||_|s(|j|_dS)Nr)rr<00> destination<6F>destination_path<74>default_destination_path)rrMrNrrr
r
r r<00>s 
zOutput.__init__cCsd|j|j|jfS)Nz'%s: destination=%r, destination_path=%r)rrMrN)rr
r
r r <00>szOutput.__repr__cCst<00>dS)z;`data` is a Unicode string, to be encoded by `self.encode`.N)r!)rr3r
r
r <00>write<74>sz Output.writecCsL|jr*|j<00><01>dkr*t|t<03>s&td<02><01>|St|t<03>s8|S|<01>|j|j<06>SdS)Nr#zFthe encoding given is "unicode" but the output is not a Unicode string)rr*r+r,r-<00>encoder)rr3r
r
r rQ<00>s 
z Output.encode)NNNr)
rrr rDrErOrr rPrQr
r
r
r rK<00>s
rKc@sLeZdZdZdddddejdkr$dndfdd <09>Zd
d <0B>Zd d <0A>Zdd<0F>Z dS)<10> FileInputz5
Input for single, simple file-like objects.
NrT)<02><00><00>rZrUc
Ks4t<00>|||||<04>||_t<03>|_x.|D]&}|dkr@tj<06>d<02>q&td|<00><01>q&W|dkr<>|r<>tj dkrv|j
|j d<06>}ni}yt ||f|<07>|_ Wq<>tk
r<EFBFBD>} zt| j| j|<02><03>Wdd} ~ XYq<>Xntj|_ n6tj dk<05>rt|j |j
<EFBFBD>dk<08>rtd|j
|j j
f<00><01>|<02>s0y|j j|_Wntk
<EFBFBD>r.YnXdS) a<>
:Parameters:
- `source`: either a file-like object (which is read directly), or
`None` (which implies `sys.stdin` if no `source_path` given).
- `source_path`: a path to a file, which is opened and then read.
- `encoding`: the expected text encoding of the input file.
- `error_handler`: the encoding error handler to use.
- `autoclose`: close automatically after read (except when
`sys.stdin` is the source).
- `mode`: how the file is to be opened (see standard function
`open`). The default 'rU' provides universal newline support
for text files on Python < 3.4.
<20>handle_io_errorsz<73>deprecation warning: io.FileInput() argument `handle_io_errors` is ignored since Docutils 0.10 (2012-12-16) and will soon be removed.z2__init__() got an unexpected keyword argument '%s'N)rSr)r<00>errorsFzOEncoding clash: encoding given is "%s" but source is opened with encoding "%s".)rr<00> autocloser<00>_stderr<72>sys<79>stderrrPr<00> version_inforr<00>openr<00>IOErrorr<00>errno<6E>strerror<6F>stdinrr1<00>namerr)
rrrrrrX<00>mode<64>kwargs<67>keyr8r
r
r r<00>s8
 
 $
 zFileInput.__init__c
Cs<>z<>yD|jtjkr:tjdkr:|jj<04><05>}d<02>|<01><07><00>d}n
|j<00><05>}Wndtt fk
r<EFBFBD>}zB|j
s<EFBFBD>|j r<>t |j d<03>}|<03><05>}|<03> <0A>d<02>|<01><07><00>d}n<02>Wdd}~XYnXWd|jr<>|<00> <0A>X|<00>|<01>S)zU
Read and decode a single file and return the data (Unicode string).
)rSr<00>
<EFBFBD>rbN)rrZrar\<00>bufferr"r2r>r1rrrr]<00>closerXr9)rr3r7Zb_sourcer
r
r r"s   
zFileInput.readcCs|<00><00><00>d<01>S)zK
Return lines of a single file as list of Unicode strings.
T)r"r>)rr
r
r <00> readlines!szFileInput.readlinescCs|jtjk r|j<00><03>dS)N)rrZrari)rr
r
r ri's zFileInput.close)
rrr rDrZr\rr"rjrir
r
r
r rR<00>s7rRc@s6eZdZdZdZddd<07>Zdd <09>Zd
d <0B>Zd d <0A>ZdS)<0F>
FileOutputz6
Output for single, simple file-like objects.
<20>wNrTcCs<>t<00>|||||<04>d|_||_|dk r,||_t<05>|_|dkrR|rHd|_q<>tj|_ n6|r<>t
|j d<04>r<>||j jkr<>t d|j j|f|jd<06>|s<>y|j j |_ Wntk
r<EFBFBD>YnXdS)aA
:Parameters:
- `destination`: either a file-like object (which is written
directly) or `None` (which implies `sys.stdout` if no
`destination_path` given).
- `destination_path`: a path to a file, which is opened and then
written.
- `encoding`: the text encoding of the output file.
- `error_handler`: the encoding error handler to use.
- `autoclose`: close automatically after write (except when
`sys.stdout` or `sys.stderr` is the destination).
- `handle_io_errors`: ignored, deprecated, will be removed.
- `mode`: how the file is to be opened (see standard function
`open`). The default is 'w', providing universal newline
support for text files.
TNFrcz?Warning: Destination mode "%s" differs from specified mode "%s")<01>file)rKr<00>openedrXrcrrYrZ<00>stdoutrM<00>hasattr<74>printrbrNr)rrMrNrrrXrVrcr
r
r r8s(

 zFileOutput.__init__c
Cs<>tjdkr$d|jkr$|j|jd<03>}ni}yt|j|jf|<01>|_Wn4tk
rt}zt |j
|j |j<06><03>Wdd}~XYnXd|_ dS)N)rSr<00>b)rrWT) rZr\rcrrr]rNrMr^r r_r`rn)rrdr8r
r
r r]cs 
zFileOutput.openc Csf|js|<00><01>d|jkr"tjdks4t|j|j<07>dkrf|<00>|<01>}tjdkrft j
dkrf|<01> dt t j
d<06><02>}z<>y|j<06> |<01>Wn<>tk
<EFBFBD>r}zvtjdkr<>t|t <0C>r<>y|jj<10> |<01>WnJtk
r<EFBFBD>t|j|j<07>dkr<>td|jp<>d|jj|jf<00><01>n|<02>YnXWd d }~XYn>ttfk
<EFBFBD>rJ}ztd
|jt|<03>f<00><01>Wd d }~XYnXWd |j<17>r`|<00><18>X|S) z<>Encode `data`, write it to a single file, and return it.
With Python 3 or binary output mode, `data` is returned unchanged,
except when specified encoding and output encoding differ.
rr)rSrF<>
rfr;z;Encoding of %s (%s) differs
from specified encoding (%s)rMNz:Unable to encode output data. output-encoding is: %s.
(%s))rnr]rcrZr\rrMrrQ<00>os<6F>linesepr0<00>bytesrPrr+rhr<00>
ValueErrorrNr1rrrXri)rr3<00>er7r
r
r rPqs6
 (
zFileOutput.writecCs&|jtjtjfkr"|j<00><04>d|_dS)NF)rMrZror[rirn)rr
r
r ri<00>s
zFileOutput.close)NNNrTNN) rrr rDrcrr]rPrir
r
r
r rk,s
)'rkc@seZdZdZdZdS)<04>BinaryFileOutputzL
A version of docutils.io.FileOutput which writes to a binary file.
<20>wbN)rrr rDrcr
r
r
r ry<00>sryc@seZdZdZdZdd<04>ZdS)<06> StringInputz
Direct string input.
z<string>cCs |<00>|j<01>S)z$Decode and return the source string.)r9r)rr
r
r r"<00>szStringInput.readN)rrr rDrr"r
r
r
r r{<00>sr{c@seZdZdZdZdd<04>ZdS)<06> StringOutputz
Direct string output.
z<string>cCs|<00>|<01>|_|jS)z=Encode `data`, store it in `self.destination`, and return it.)rQrM)rr3r
r
r rP<00>s zStringOutput.writeN)rrr rDrOrPr
r
r
r r|<00>sr|c@seZdZdZdZdd<04>ZdS)<06> NullInputz)
Degenerate input: read nothing.
z
null inputcCsdS)zReturn a null string.r%r
)rr
r
r r"<00>szNullInput.readN)rrr rDrr"r
r
r
r r}<00>sr}c@seZdZdZdZdd<04>ZdS)<06>
NullOutputz+
Degenerate output: write nothing.
z null outputcCsdS)z6Do nothing ([don't even] send data to the bit bucket).Nr
)rr3r
r
r rP<00>szNullOutput.writeN)rrr rDrOrPr
r
r
r r~<00>sr~c@seZdZdZdZdd<04>ZdS)<06> DocTreeInputzm
Adapter for document tree input.
The document tree must be passed in the ``source`` parameter.
z doctree inputcCs|jS)zReturn the document tree.)r)rr
r
r r"<00>szDocTreeInput.readN)rrr rDrr"r
r
r
r r<00>sr)rDZ __docformat__rZrtrFr ZdocutilsrZdocutils.utils.error_reportingrrrr^rr rrrKrRrkryr{r|r}r~rr
r
r
r <00><module>s( p0er