← Back
Editing: zippath.cpython-38.pyc
U W[$ � @ s� d Z ddlmZmZ ddlZddlZddlZddlmZ ddl m Z mZ ddlm Z mZmZ ddlmZ ddlmZ dd lmZ d Ze ee �G dd� de���ZG d d� de�ZddgZdS )zt This module contains implementations of L{IFilePath} for zip files. See the constructor of L{ZipArchive} for use. � )�absolute_import�divisionN)�ZipFile)� comparable�cmp)� IFilePath�FilePath�AbstractFilePath)�_coerceToFilesystemEncoding)�UnlistableError)�implementer�/c @ s� e Zd ZdZdd� Zdd� Zdd� Zedd � �Zd d� Z dd � Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd.d!d"�Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-S )/�ZipPathzF I represent a file or directory contained within a zip file. c C sD || _ || _t|t�}t||jj�}tjj|f| j� |��� | _dS )z� Don't construct me directly. Use C{ZipArchive.child()}. @param archive: a L{ZipArchive} instance. @param pathInArchive: a ZIP_PATH_SEP-separated string. N) �archive� pathInArchiver �ZIP_PATH_SEP�zipfile�filename�os�path�join�split)�selfr r �sepZarchiveFilename� r �8/usr/lib/python3/dist-packages/twisted/python/zippath.py�__init__% s � �zZipPath.__init__c C s( t |t�stS t| j| jf|j|jf�S �N)� isinstancer �NotImplementedr r r )r �otherr r r �__cmp__9 s �zZipPath.__cmp__c C sL t | jtj�| jj��g}|�| j�| j�� t | jtj�}d|� |�f S )NzZipPath(%r)) r r r r �abspathr �extendr r r )r �partsZossepr r r �__repr__@ s �zZipPath.__repr__c C s t | jt�S )z� Return a zip directory separator. @return: The zip directory separator. @returntype: The same type as C{self.path}. )r r r �r r r r r H s zZipPath.sepc C s<