File: //home/arjun/projects/env/lib/python3.10/site-packages/pathlib_mate/mate_mutate_methods.pyc
�
�ɴac @ s` d Z d d l Z d d l Z y d d l m Z Wn e k
rE n Xd e f d � � YZ d S( s.
Provide methods to mutate the Path instance.
i����Ni ( t Patht
MutateMethodsc B s� e Z d Z d d � Z d � Z d d d d d d d � Z e d � Z d d d d d d e e d � Z d d d d d d e e d � Z
d � Z d � Z d
� Z
RS( s6
Provide methods to mutate the Path instance.
i c C s | j | j | � S( s�
Drop parts from the ends.
:param n: integer, number of parts you wants to drop from ends.
n has to greater equal than 0.
:rtype: Path
:returns: a new Path object.
Example::
>>> self.__class__("/usr/bin/python").drop_parts(1)
"/user/bin"
>>> self.__class__("/usr/bin/python").drop_parts(2)
"/user"
( t __class__t parts( t selft n( ( s# pathlib_mate/mate_mutate_methods.pyt
drop_parts s c G s | j | | � S( sq
Append some parts to the end of this path.
:rtype: Path
:returns: a new Path object.
Example::
>>> self.__class__("/usr/bin/python").append_parts("lib")
"/user/bin/python/lib"
>>> self.__class__("/usr/bin/python").append_parts("lib", "core.py")
"/user/bin/python/lib/core.py"
( R ( R R ( ( s# pathlib_mate/mate_mutate_methods.pyt append_parts+ s c C sA | d k r | j | � } | S| d k rU | d k rU t j j | j j | � } nl | d k rv | d k rv | } nK | d k r� | d k r� | j } n'