Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)
Gives the display value for a given path, making it relative to cwd
if possible.

        def display_path(path):
    """Gives the display value for a given path, making it relative to cwd
    if possible."""
    path = os.path.normcase(os.path.abspath(path))
    if path.startswith(os.getcwd() + os.path.sep):
        path = '.' + path[len(os.getcwd()):]
    return path
        


src/x/p/XPpkg-0.3dev.3/xppkg/download.py   XPpkg(Download)
from xppkg.backwardcompat import string_types
from xppkg.exceptions import InstallationError
from xppkg.util import create_download_cache_folder, splitext, format_size, display_path, backup_dir, ask_path_exists, unpack_file, cache_download
from xppkg.log import logger
 
        response = ask_path_exists(
            'The file %s exists. (i)gnore, (w)ipe, (b)ackup ' %
            display_path(download_location), ('i', 'w', 'b'))
        if response == 'i':
            copy = False
        elif response == 'w':
            logger.warn('Deleting %s' % display_path(download_location))
            dest_file = backup_dir(download_location)
            logger.warn('Backing up %s to %s'
                        % (display_path(download_location), display_path(dest_file)))
            shutil.move(download_location, dest_file)
    if copy: