Your IP : 216.73.216.134


Current Path : /opt/rh/rh-python35/root/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/rh/rh-python35/root/lib64/python3.5/__pycache__/shutil.cpython-35.pyc



���\,��9@s2dZddlZddlZddlZddlZddlZddlZddlZyddlZ[dZ	Wne
k
r�dZ	YnXyddlZ[dZWne
k
r�dZYnXyddl
mZWne
k
r�dZYnXyddlmZWne
k
rdZYnXddd	d
ddd
ddddddddddddddddddgZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d�de�ZGd$d%�d%e�ZGd&d'�d'e�Zd�d*d�Zd+d,�Zd-dd.d�Zd-dd/d	�Zeed0�rXd-dd1d2�Znd3d2�Zd-dd4d
�Z d-dd5d�Z!d-dd6d�Z"d7d�Z#dde"dd8d
�Z$d9d:�Z%d;d<�Z&ej'ejej(ej)hej*koej+ej,koejej-kZ.ddd=d�Z/e.e/_0d>d?�Z1e"d@d�Z2dAdB�Z3dCdD�Z4dEdF�Z5dGddddddHdI�Z6ddddJdK�Z7dLe6d�gdNfdOe6d�gdPfdQe7gdRfiZ8e	re6d�gdTfe8dU<ere6d�gdWfe8dX<dYd�Z9ddZd[d�Z:d\d�Z;dddddddd]d�Z<d^d�Z=d_d`�Z>ddZdad�Z?dbd�Z@dcdd�ZAdedf�ZBdgdh�ZCdLdidjgeCgdNfdOdkgeCgdPfdQdlgeBgdRfiZDe	r.dmdngeCgdTfeDdU<erPdodpgeCgdWfeDdX<dqdr�ZEdddsd�ZFeedt�r�ejGdu�ejHdvdw�ZIdxdu�ZJnFejKdykr�ddlLZLejGdu�ejHdvdw�ZIdzdu�ZJddd{d�ZMd�d~d�ZNejOejPBddd�ZQdS)�z�Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

�NTF)�getpwnam)�getgrnam�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)r
N)�__name__�
__module__�__qualname__�r r �6/opt/rh/rh-python35/root/usr/lib64/python3.5/shutil.pyr
1sc@seZdZdZdS)rz5Raised when source and destination are the same file.N)rrr�__doc__r r r r!r4sc@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)N)rrrr"r r r r!r7sc@seZdZdZdS)rz+Raised when a command could not be executedN)rrrr"r r r r!r;sc@seZdZdZdS)�	ReadErrorz%Raised when an archive cannot be readN)rrrr"r r r r!r#>sr#c@seZdZdZdS)�
RegistryErrorzWRaised when a registry operation with the archiving
    and unpacking registeries failsN)rrrr"r r r r!r$Asr$�icCs.x'|j|�}|sP|j|�qWdS)z=copy data from file-like object fsrc to file-like object fdstN)�read�write)�fsrc�fdstZlengthZbufr r r!rFs
cCs|ttjd�rBytjj||�SWntk
rAdSYnXtjjtjj|��tjjtjj|��kS)N�samefileF)�hasattr�os�pathr*�OSError�normcase�abspath)�src�dstr r r!�	_samefileNs
	r3�follow_symlinkscCst||�r'tdj||���x^||gD]P}ytj|�}Wntk
raYq4Xtj|j�r4td|��q4W|r�tj	j
|�r�tjtj|�|�n?t
|d��-}t
|d��}t||�WdQRXWdQRX|S)z�Copy data from src to dst.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    z{!r} and {!r} are the same filez`%s` is a named pipe�rb�wbN)r3r�formatr,�statr.�S_ISFIFO�st_moderr-�islink�symlink�readlink�openr)r1r2r4�fn�str(r)r r r!rZs
cCs�|rWtjj|�rWtjj|�rWttd�rPtjtj}}q�dSn)ttd�r|tjtj}}ndS||�}||tj|j	��dS)z�Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    �lchmodN�chmod)
r,r-r;r+�lstatrAr8rB�S_IMODEr:)r1r2r4Z	stat_funcZ
chmod_funcr@r r r!rws+�	listxattrcCs�ytj|d|�}WnGtk
rb}z'|jtjtjfkrL�dSWYdd}~XnXx�|D]�}y5tj||d|�}tj|||d|�Wqjtk
r�}z)|jtjtjtjfkr��WYdd}~XqjXqjWdS)z�Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        r4N)	r,rEr.�errno�ENOTSUPZENODATA�getxattr�setxattrZEPERM)r1r2r4�names�e�name�valuer r r!�
_copyxattr�s	
!rNcOsdS)Nr )�args�kwargsr r r!rN�sc	s�dddddd��|p@tjj|�o?tjj|�}|r^�fdd�}n�fdd�}|d	�|d|�}tj|j�}|d
�|d|j|jfd|�y|d�||d|�Wntk
r�YnXt	|d�r�y |d
�||j
d|�Wnatk
r�}zAx9dD].}t	t|�r?|jt
t|�kr?Pq?W�WYdd}~XnXt||d|�dS)z�Copy all stat info (mode bits, atime, mtime, flags) from src to dst.

    If the optional flag `follow_symlinks` is not set, symlinks aren't followed if and
    only if both `src` and `dst` are symlinks.

    �nsNr4cWsdS)Nr )rQr4rOr r r!�_nop�szcopystat.<locals>._nopcstt|��S)N)�getattrr,)rL)rRr r!�lookup�szcopystat.<locals>.lookupcs)tt|��}|tjkr%|S�S)N)rSr,�supports_follow_symlinks)rLr?)rRr r!rT�sr8�utimerB�st_flagsZchflags�
EOPNOTSUPPrG)rXzENOTSUP)r,r-r;r8rDr:�st_atime_ns�st_mtime_ns�NotImplementedErrorr+rWr.rFrSrN)	r1r2r4ZfollowrTr@�mode�why�errr )rRr!r�s,+!
 
'cCs]tjj|�r3tjj|tjj|��}t||d|�t||d|�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    r4)r,r-�isdir�join�basenamerr)r1r2r4r r r!r�s
!cCs]tjj|�r3tjj|tjj|��}t||d|�t||d|�|S)z�Copy data and all stat info ("cp -p src dst"). Return the file's
    destination."

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    r4)r,r-r_r`rarr)r1r2r4r r r!r	�s

!cs�fdd�}|S)z�Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude filescs:g}x'�D]}|jtj||��q
Wt|�S)N)�extend�fnmatch�filter�set)r-rJ�
ignored_names�pattern)�patternsr r!�_ignore_patternss
z)ignore_patterns.<locals>._ignore_patternsr )rhrir )rhr!r�scCsstj|�}|dk	r-|||�}n	t�}tj|�g}x�|D]�}	|	|kreqPtjj||	�}
tjj||	�}y�tjj|
�r7tj|
�}|r�tj||�t	|
|d|�qotjj
|�r�|r�wPtjj|
�r't|
||||�qo||
|�n8tjj|
�rbt|
||||�n
||
|�WqPt
k
r�}
z|j|
jd�WYdd}
~
XqPtk
r�}z!|j|
|t|�f�WYdd}~XqPXqPWyt	||�WnYtk
r\}z9t|dd�dkrJ|j||t|�f�WYdd}~XnX|rot
|��|S)a�Recursively copy a directory tree.

    The destination directory must not already exist.
    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    Nr4rZwinerror)r,�listdirre�makedirsr-r`r;r=r<r�existsr_r
r
rbrOr.�append�strrS)r1r2�symlinks�ignore�
copy_functionZignore_dangling_symlinksrJrf�errorsrLZsrcnameZdstname�linktor^r]r r r!r
sL$	


&3/c$Cs�y"tjj|�r!td��Wn2tk
rV|tjj|tj��dSYnXg}ytj|�}Wn+tk
r�|tj|tj��YnXx�|D]�}tjj||�}ytj|�j	}Wntk
r�d}YnXt
j|�rt||�q�ytj
|�Wq�tk
rN|tj
|tj��Yq�Xq�Wytj|�Wn+tk
r�|tj|tj��YnXdS)Nz%Cannot call rmtree on a symbolic linkr)r,r-r;r.�sys�exc_inforjr`rCr:r8�S_ISDIR�_rmtree_unsafe�unlink�rmdir)r-�onerrorrJrL�fullnamer\r r r!rwes6
	



"
rwc
0Cs@g}ytj|�}WnGtk
rb}z'||_|tj|tj��WYdd}~XnXx�|D]�}tjj||�}y(tj|d|dd�}|j	}Wntk
r�d}YnXtj
|�r�ytj|tjd|�}	Wn+tk
r#|tj|tj��Yq8Xz�tjj
|tj|	��r�t|	||�ytj|d|�Wq�tk
r�|tj|tj��Yq�XnAytd��Wn.tk
r�|tjj|tj��YnXWdtj|	�Xqjytj|d|�Wqjtk
r7|tj|tj��YqjXqjWdS)N�dir_fdr4Frz%Cannot call rmtree on a symbolic link)r,rjr.�filenamertrur-r`r8r:rvr>�O_RDONLY�samestat�fstat�_rmtree_safe_fdryr;�closerx)
�topfdr-rzrJr^rLr{�orig_str\�dirfdr r r!r��sD	,




!
%
r�c!Cs�|rdd�}n|dkr-dd�}tr�t|t�rQtj|�}ytj|�}Wn/tk
r�|tj|tj��dSYnXytj	|tj
�}Wn/tk
r�|tj|tj��dSYnXz�tjj|tj
|��rTt|||�ytj|�Wq�tk
rP|tj|tj��Yq�XnAytd��Wn.tk
r�|tjj|tj��YnXWdtj|�Xn
t||�SdS)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    cWsdS)Nr )rOr r r!rz�szrmtree.<locals>.onerrorNcWs�dS)Nr )rOr r r!rz�sz%Cannot call rmtree on a symbolic link)�_use_fd_functions�
isinstance�bytesr,�fsdecoderC�	Exceptionrtrur>r~r-rr�r�ryr.r;r�rw)r-�
ignore_errorsrzr��fdr r r!r�s<
	
	
!
%cCs5tjjtjjpd}tjj|j|��S)N�)r,r-�sep�altsepra�rstrip)r-r�r r r!�	_basename�sr�c
Cs]|}tjj|�rxt||�r;tj||�dStjj|t|��}tjj|�rxtd|��ytj||�Wn�t	k
rXtjj
|�r�tj|�}tj||�tj
|�nwtjj|�r:t||�rtd||f��t||d|dd�t|�n|||�tj
|�YnX|S)a+Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.rqroT)r,r-r_r3�renamer`r�rlr
r.r;r=r<rx�
_destinsrcr
r)r1r2rqZreal_dstrsr r r!r�s2


cCs{tjj|�}tjj|�}|jtjj�sI|tjj7}|jtjj�sn|tjj7}|j|�S)N)r,r-r0�endswithr��
startswith)r1r2r r r!r�,sr�cCs_tdks|dkrdSyt|�}Wntk
rFd}YnX|dk	r[|dSdS)z"Returns a gid, given a group name.N�)r�KeyError)rL�resultr r r!�_get_gid5s
r�cCs_tdks|dkrdSyt|�}Wntk
rFd}YnX|dk	r[|dSdS)z"Returns an uid, given a user name.Nr�)rr�)rLr�r r r!�_get_uidAs
r��gzipc
s�ddddi}ddi}	tr8d|d<d|	d<trRd	|d	<d
|	d	<|dk	r||	krtdj|���|d|	j|d�}
tjj|
�}|r�tjj|�r�|dk	r�|j	d
|�|s�tj
|�|dk	r|j	d�t���t�������fdd�}|s�t
j|
d||�}
z|
j|d|�Wd|
j�X|
S)a�Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    r�ZgzNr�z.gz�bz2�bzip2z.bz2�xzz.xzzCbad value for 'compress', or compression format not supported : {0}z.tarzcreating %szCreating tar archivecs@�dk	r�|_�|_�dk	r<�|_�|_|S)N)�gidZgname�uid�uname)Ztarinfo)r��group�ownerr�r r!�_set_uid_gid}s				z#_make_tarball.<locals>._set_uid_gidzw|%srd)�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorr7�getr,r-�dirnamerl�inforkr�r��tarfiler>�addr�)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionZcompress_extZarchive_name�archive_dirr��tarr )r�r�r�r�r!�
_make_tarballMs:



	

	r�c
Cs�ddl}|d}tjj|�}|rptjj|�rp|dk	r]|jd|�|sptj|�|dk	r�|jd||�|s�|j|dd|j��<}tjj	|�}	|j
|	|	�|dk	r�|jd|	�x�tj|�D]�\}
}}xat|�D]S}
tjj	tjj
|
|
��}	|j
|	|	�|dk	r|jd|	�qWxm|D]e}
tjj	tjj
|
|
��}	tjj|	�r{|j
|	|	�|dk	r{|jd|	�q{WqWWdQRX|S)	amCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises ExecError.  Returns the name of the output zip
    file.
    rNz.zipzcreating %sz#creating '%s' and adding '%s' to it�wZcompressionzadding '%s')�zipfiler,r-r�rlr�rk�ZipFileZZIP_DEFLATED�normpathr'�walk�sortedr`�isfile)r�r�r�r�r�r�Zzip_filenamer�Zzfr-�dirpathZdirnames�	filenamesrLr r r!�
_make_zipfile�s>	

	
!
!r�Zgztarr�zgzip'ed tar-filer�zuncompressed tar file�zipzZIP filer�zbzip2'ed tar-fileZbztarr�zxz'ed tar-fileZxztarcCs'dd�tj�D�}|j�|S)z�Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    cSs&g|]\}}||df�qS)r�r )�.0rL�registryr r r!�
<listcomp>�s	z'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort)�formatsr r r!r�s	
r�cCs�|dkrg}t|�s.td|��t|ttf�sOtd��xB|D]:}t|ttf�s�t|�dkrVtd��qVW|||ft|<dS)auRegisters an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorr��tuple�list�lenr�)rL�function�
extra_args�description�elementr r r!r�s	
(cCst|=dS)N)r�)rLr r r!r�sc	CsUtj�}	|dk	rY|dk	r4|jd|�tjj|�}|sYtj|�|dkrntj}d|d|i}
yt|}Wn"tk
r�t	d|��YnX|d}x"|dD]\}
}||
|
<q�W|dkr||
d	<||
d
<z||||
�}Wd|dk	rP|dk	rC|jd|	�tj|	�X|S)a�Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "bztar"
    or "gztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'r�r�zunknown archive format '%s'r�r�r�r�zchanging back to '%s')
r,�getcwd�debugr-r0�chdir�curdirr�r�r�)r�r7Zroot_dirr�r�r�r�r�r�Zsave_cwdrP�format_info�func�arg�valr}r r r!r�s6
	



cCs'dd�tj�D�}|j�|S)z�Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    cSs-g|]#\}}||d|df�qS)r�r )r�rLr�r r r!r�*s	z&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSr�r�)r�r r r!r$s	
c	Cs�i}x9tj�D]+\}}x|dD]}|||<q*WqWx:|D]2}||krId}t||||f��qIWt|�s�td��dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r�r�r$r�r�)	�
extensionsr�r�Zexisting_extensionsrLr��ext�	extension�msgr r r!�_check_unpack_options/s
	r�cCs<|dkrg}t|||�||||ft|<dS)aMRegisters an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    N)r�r�)rLr�r�r�r�r r r!rAscCst|=dS)z+Removes the pack format from the registery.N)r�)rLr r r!rWscCs5tjj|�}tjj|�s1tj|�dS)z1Ensure that the parent directory of `path` existsN)r,r-r�r_rk)r-r�r r r!�_ensure_directory[sr�c	Cs6yddl}Wntk
r0td��YnX|j|�sPtd|��|j|�}z�x�|j�D]�}|j}|jd�sod|kr�qotj	j
||jd��}|s�qot|�|j
d�so|j|j�}t|d�}z|j|�Wd|j�~XqoWWd|j�XdS)z+Unpack zip `filename` to `extract_dir`
    rNz/zlib not supported, cannot unpack this archive.z%s is not a zip file�/z..r6)r��ImportErrorr#Z
is_zipfiler�Zinfolistr}r�r,r-r`�splitr�r�r&r>r'r�)	r}�extract_dirr�r�r�rL�target�data�fr r r!�_unpack_zipfileas0
	

r�cCs^ytj|�}Wn%tjk
r:td|��YnXz|j|�Wd|j�XdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    z/%s is not a compressed or uncompressed tar fileN)r�r>ZTarErrorr#Z
extractallr�)r}r�Ztarobjr r r!�_unpack_tarfile�sr�z.tar.gzz.tgzz.tarz.zipz.tar.bz2z.tbz2z.tar.xzz.txzcCsIxBtj�D]4\}}x%|dD]}|j|�r$|Sq$Wq
WdS)Nr)r�r�r�)r}rLr�r�r r r!�_find_unpack_format�s
r�cCs�|dkrtj�}|dk	r�yt|}Wn'tk
r[tdj|���YnX|d}|||t|d��n_t|�}|dkr�tdj|���t|d}tt|d�}||||�dS)a�Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", or "gztar". Or any
    other registered format. If not provided, unpack_archive will use the
    filename extension and see if an unpacker was registered for that
    extension.

    In case none is found, a ValueError is raised.
    NzUnknown unpack format '{0}'r�r�zUnknown archive format '{0}')	r,r�r�r�r�r7�dictr�r#)r}r�r7r�r�rPr r r!r�s

�statvfs�
disk_usageZusageztotal used freecCsVtj|�}|j|j}|j|j}|j|j|j}t|||�S)z�Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r,r��f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)r-r@�free�total�usedr r r!r��s
�ntcCs/tj|�\}}||}t|||�S)z�Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r�Z
_getdiskusager�)r-r�r�r�r r r!r��s
cCs�|dkr$|dkr$td��|}|}|dkrEd}n<t|t�r�t|�}|dkr�tdj|���|dkr�d}n<t|t�s�t|�}|dkr�tdj|���tj	|||�dS)z�Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    Nzuser and/or group must be setr�zno such user: {!r}zno such group: {!r}���r�)
r�r�rnr��LookupErrorr7�intr�r,r)r-�userr�Z_userZ_groupr r r!r�s"		�P�cCsyttjd�}Wnttfk
r7d}YnXyttjd�}Wnttfk
rod}YnX|dks�|dkr�ytjtjj��}Wn't	t
fk
r�tj|�}YnX|dkr�|j}|dkr�|j
}tj||f�S)aGet the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    ZCOLUMNSrZLINES)r�r,�environr�r�rrt�
__stdout__�fileno�	NameErrorr.�
terminal_size�columns�lines)Zfallbackrr�sizer r r!rs$		cs�dd�}tjj��r5|�|�r1�SdS|dkrYtjjdtj�}|scdS|jtj�}tj	dkrtj
|kr�|jdtj
�tjjdd�jtj�}t�fd	d
�|D��r��g}q�fdd�|D�}n	�g}t
�}xr|D]j}tjj|�}||kr'|j|�x6|D].}	tjj||	�}
||
|�r_|
Sq_Wq'WdS)
a3Given a command, mode, and a PATH string, return the path which
    conforms to the given mode on the PATH, or None if there is no such
    file.

    `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
    of os.environ.get("PATH"), or can be overridden with a custom search
    path.

    cSs5tjj|�o4tj||�o4tjj|�S)N)r,r-rl�accessr_)r?r\r r r!�
_access_checkFs$zwhich.<locals>._access_checkN�PATH�win32rZPATHEXTr�c3s*|] }�j�j|j��VqdS)N)�lowerr�)r�r�)�cmdr r!�	<genexpr>cszwhich.<locals>.<genexpr>csg|]}�|�qSr r )r�r�)rr r!r�fs	zwhich.<locals>.<listcomp>)r,r-r�r�r��defpathr��pathseprt�platformr��insert�anyrer/r�r`)rr\r-rZpathext�files�seen�dirZnormdirZthefilerLr )rr!r9s8
!		


i@)�compresszgzip)rN)rzbzip2)rzxz)r�r�)Rr"r,rtr8rc�collectionsrFr�r�r�r�Zlzmar��pwdrZgrpr�__all__r.r
rrrr#r�r$rr3rrr+rNrrr	rr
rwr�r>rxry�supports_dir_fdrj�supports_fdrUr�rZavoids_symlink_attacksr�rr�r�r�r�r�r�rrrrrr�rrr�r�r�r�r�rrm�
namedtupler�r�rLr�rr�F_OK�X_OKrr r r r!�<module>s�





		6	Y!,5	8		A/	
	

	6%

%

+

Rosenblum TV: Video training, virtual workshops, classes, tutorials
logologologologo
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact

RE-INVENTING THE TELEVISION NEWS BUSINESS*

A revolution in video storytelling

Creating entirely new & cost-effective production methods

From the world leaders in video production training and the creators of Character Driven Storytelling™

*and every other business that uses video

WHAT WE DO

Over the past 35 years, we have designed, built or restructured some of the most powerful news and journalism companies in the world.

We replace the traditional TV news ‘crew’ with one highly trained journalist, working alone with nothing but an iPhone.

No more TV news ‘crews’, no editors and no field producers.

This is television news done the way newspaper journalism is done – one reporter with their electronic pad and pencil.

In doing this, we can cut the cost of production by as much as 75% while increasing ratings and audience engagement.

In the place of conventional TV news ‘packages’ – ie, reporter stand up, interview, b-roll, man on the street, we marry great journalism with Netflix and Hollywood storytelling.

It’s a combination that works.

We have taken most of our clients to #1 in their respective markets.

And it’s not just for news. Any company, any profit, any NGO and anyone else who is online needs to tell their story in compelling yet cost-effective video. We can teach you to do that. Either in person or virtually.

EXAMPLES OF WHAT WE CAN TEACH YOUR STAFF TO PRODUCE

ITAY HOD

Itay Hod, MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2018.

Because he works alone, with only an iPhone, he was able to embed himself with a homeless family.

Here’s the story he produced in a one-day turn.

KIET DO

Kiet Do, an MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2021.

Here is a story he produced, all on his own, with only an iPhone and in a one-day turn.

TAYLOR SCHAUB

Taylor Schaub, an MMJ with Spectrum News 1 in LA, took the 5-Day Intensive Video Storytelling Bootcamp in 2023.

Here is a story he turned in only one day, using only an iPhone. It was the first video story he ever did and it was nominated for an Emmy.

THE BOOTCAMP

How do we convert stations and whole networks to working in this way?

Since 1988, we have run intensive 5-Day Video Storytelling Bootcamps

We have done these all over the world.

These are hands-on bootcamps, and participants learn an entirely new way of creating TV news stories.

-We shoot at a 3:1 ratio or lower, so turnaround times are fast.

-We go directly from camera to timelilne and edit – no written scripts.  We work in the medium of pictures and sound.

-We are entirely character-driven.

-We are driven by pictures and real events.

-We are focused almost entirely on ’the viewer experience’.

Since 1988, more than 70,000 journalists around the world have taken our bootcamps, either in person on virtualy.

Case Studies

CBS Case Study Logos
CBS News

We have started to work with CBS News, bringing our ideas of character-driven storytelling to one of the most successful and biggest networks in the United States. Since beginning to work with them ratings have climbed and more importantly, audience engagement is through the ceiling.

Learn More
NYT Case Study Logos
New York Times Television

We started New York Times Television in 1990 and it was the first paper to be brought into the world of TV. It quickly became one of the most successful non-fiction production companies in the United States. The series and documentaries we produced won many awards including multiple Emmys.

Learn More
BBC Case Study Logos
The BBC

We have been working with the BBC since the year 2000 helping to convert their national news network to our visual storytelling technique. Most recently we have trained teams from their sports, documentaries, and comedy divisions to make character-driven stories using only smartphones.

Learn More
Spectrum Case Study Logos
Spectrum News

For the past five years we have worked with Spectrum News to introduce and train their journalists on visual, character driven storytelling using smartphones helping to create a different kind of local news for their network of 24-Hour News Stations across the United States.

Learn More
UN Case Study Logos
The United Nations

In 2006, we were approached by the United Nations. Rather than rely on news outlets, it would be much easier to train the field operatives to produce their own stories. We spent two years working with the UN, training more than 100 of their staff in bootcamps in Geneva and Nairobi.

Learn More
Star Ledger Case Study Logos
The Newark Star-Ledger

We trained 50 print reporters at the paper to shoot and tell their own stories, in conjunction with their print work. We built a TV newsroom in their existing print newsroom – you could not ask for a better set and they began to live stream their stories in conjunction with their print work.

Learn More
Mcgraw Hill Case Study Logos
Mcgraw Hill

We spent two years with McGraw Hill, training more than 150 of their staffers, making them completely video literate. McGraw/Hill media properties we transit included Business Week, Aviation Week, (what was the name of the architecture magazine), and JD Power and Associates.

Learn More
VOA Case Study Logos
Voice of America

In 1990, we were approached by The Voice of America, the official broadcasting agency for the United States Government. When we met with VOA, they were only a short wave radio broadcaster, but working with them, we took them into television, launching VOA-TV.

Learn More
Oyster Case Study Logos
Oyster Yachts

British based Oyster Yachts makes some of the finest yachts in the world. Like every other company, they had to find a way to feed the never-ending video demands of social media – sites like Instagram and TikTok. We trained the Oyster staff to tell their own stories, using only iPhones.

Learn More
SEPA Case Study Logos
Scottish Environmental Protection Agency

We were approached by SEPA, the Scottish Environmental Protection Agency because they had to continually find a way to ‘feed the media beast’. The result was that SEPA was able to tell their own stories, whenever they wanted, and at almost no additional cost.

Learn More
Image 11-11-22 at 6.25 PM

Michael on Media

Michael Rosenblum has been writing about the media since 1988. His work and ideas have appeared in The Guardian, The Huffington Post, Ilkeston Life and many other publications.

He has been blogging regularly for the past 35 years on this subject. Having taught media studies at Columbia University, NYU and now the University of Oxford, he is considered an expert on this subject.

Continue reading this post or look back at previous posts.

Read More

Do You Have Questions About Learning Video Skills?

If you would like to know more about our courses contact us and one of our training advisors will be happy to call you.

Contact Us

Copyright 2024. All rights reserved.