D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
python34
/
lib64
/
python3.4
/
distutils
/
__pycache__
/
Filename :
dir_util.cpython-34.pyc
back
Copy
� i fb � @ s� d Z d d l Z d d l Z d d l m Z m Z d d l m Z i a d d d d d � Z d d d d d � Z d d d d d d d d � Z d d � Z d d d d � Z d d � Z d S)zWdistutils.dir_util Utility functions for manipulating directories and directory trees.� N)�DistutilsFileError�DistutilsInternalError)�logi� � c C s� t | t � s% t d | f � � n t j j | � } g } t j j | � s[ | d k r_ | St j t j j | � � r~ | St j j | � \ } } | g } xK | r� | r� t j j | � r� t j j | � \ } } | j d | � q� Wx | D]} t j j | | � } t j j | � } t j | � r6q� n | d k rUt j d | � n | s�y t j | | � Wni t k r�} zI | j t j k o�t j j | � s�t d | | j d f � � n WYd d } ~ Xn X| j | � n d t | <q� W| S) a� Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout. Return the list of directories actually created. z(mkpath: 'name' must be a string (got %r)� r r zcreating %szcould not create '%s': %sN���)� isinstance�strr �os�path�normpath�isdir� _path_created�get�abspath�split�insert�joinr �info�mkdir�OSError�errnoZEEXISTr �args�append)�name�mode�verbose�dry_runZcreated_dirs�head�tailZtails�dZabs_head�exc� r"