Format: application/x-python-code
1 o
2
3 ��hO0 � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z e�
4 � Zdd� Zej
5 dkr6dd� Znd d� Zd
6 d� Zdd
7 � Zdd� Zd/dedefdd�ZG dd� de�Zd0defdd�Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'Zd(d)� Zd*d+� Z d1d-d.�Z!dS )2z
8 Utilities for path handling.
9 � N)�systemc C s t j�| �ot �| t j�S )zBWhether `path` is a directory, to which the user has write access.)�os�path�isdir�access�W_OK�r � r �Hc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/path.py�
10 _writable_dir s r �win32c
11 C s| zddl }W n ty } ztd�|�d}~ww |jjj}|j|j|jg|_|�d�}|| |d�}|dks9|dkr;| S |j S )z�Get a long path name (expand ~) on Windows using ctypes.
12
13 Examples
14 --------
15
16 >>> get_long_path_name('c:\\docume~1')
17 'c:\\Documents and Settings'
18
19 r Nz2you need to have ctypes installed for this to worki )
20 �ctypes�ImportError�windll�kernel32ZGetLongPathNameW� c_wchar_p�c_uint�argtypes�create_unicode_buffer�value)r r
21 �eZ_GetLongPathName�buf�rvr r r
22 �_get_long_path_name s
23
24 ��
25 �
26 r c C � | S )zDummy no-op.r r r r r
27 r 6 s c C s t | �S )z�Expand a path into its long form.
28
29 On Windows this expands any ~ in the paths. On other platforms, it is
30 a null operation.
31 )r r r r r
32 �get_long_path_name<