Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
2øªjõ ã @ s´ d dl mZ d dlZd dlmZ d dlmZmZ d dlm Z d dl
mZ G dd„ deƒZ
G d d
„ d
eƒZG dd„ deƒZd
ZejeƒZdZejeƒZdZejeƒZdZejeƒZdS )é )ÚBytesION)Ússtruct)Ú bytesjoinÚtostr)ÚOrderedDict)ÚMutableMappingc @ s e Zd ZdS )Ú
ResourceErrorN)Ú__name__Ú
__module__Ú__qualname__© r r ú:/tmp/pip-build-_d5lkt3n/fonttools/fontTools/misc/macRes.pyr s r c @ sÆ e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZdd „ Zd-dd„Z d
d„ Z
dd„ Zdd„ Zdd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zedd „ ƒZd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Zd+d,„ Zd
S ).ÚResourceReaderaÆ Reader for Mac OS resource forks.
Parses a resource fork and returns resources according to their type.
If run on OS X, this will open the resource fork in the filesystem.
Otherwise, it will open the file itself and attempt to read it as
though it were a resource fork.
The returned object can be indexed by type and iterated over,
returning in each case a list of py:class:`Resource` objects
representing all the resources of a certain type.
c C sd t ƒ | _t|dƒr|| _n>y| j|ƒ| _| jƒ dS ttfk
rV | j|ƒ| _Y nX | jƒ dS )z�Open a file
Args:
fileOrPath: Either an object supporting a ``read`` method, an
``os.PathLike`` object, or a string.
ÚreadN) r Ú
_resourcesÚhasattrÚfileÚopenResourceForkÚ _readFiler ÚIOErrorÚopenDataFork)ÚselfZ
fileOrPathr r r
Ú__init__ s
zResourceReader.__init__c C sF t | dƒr| jƒ } t| d dƒ�}|jƒ }W d Q R X t|ƒ}| |_|S )NÚ
__fspath__z/..namedfork/rsrcÚrb)r r Úopenr r Úname)ÚpathZresforkÚdataÚinfiler r r
r / s
zResourceReader.openResourceForkc C s0 t | dƒ�}|jƒ }W d Q R X t|ƒ}| |_|S )Nr )r r r r )r Zdataforkr r r r r
r 9 s
zResourceReader.openDataForkc C s | j ƒ | jƒ d S )N)Ú_readHeaderAndMapÚ
_readTypeList)r r r r
r A s zResourceReader._readFileNc C s’ |d k rLy| j j|ƒ W n tk
r4 tdƒ‚Y nX | j jƒ |krLtdƒ‚y| j j|ƒ}W n tk
rx tdƒ‚Y nX t|ƒ|krŽtdƒ‚|S )Nz-Failed to seek offset ('offset' is too large)z#Failed to seek offset (reached EOF)z.Cannot read resource ('numBytes' is too large)z&Cannot read resource (not enough data))r ÚseekÚ
OverflowErrorr Útellr Úlen)r ZnumBytesÚoffsetr r r r
Ú_readE s zResourceReader._readc C sh | j jdƒ | jtƒ}tjt|| ƒ | jd }| jt|ƒ}tjt || ƒ | j| j
| _| j| j | _
d S )Nr é )r r" r' ÚResourceForkHeaderSizer ÚunpackÚResourceForkHeaderÚ mapOffsetÚResourceMapHeaderSizeÚResourceMapHeaderZtypeListOffsetÚabsTypeListOffsetZnameListOffsetÚabsNameListOffset)r Z
headerDatar, ZresourceMapDatar r r
r U s
z ResourceReader._readHeaderAndMapc C sª | j }| jd|ƒ}tjd|ƒ\| _|d }xzt| jd ƒD ]h}|t| }| jt|ƒ}tjt|ƒ}t |d dd�}||d } |d d }
| j
|| |
ƒ}|| j|<