scripts/pdk-linker.py
def link_files(source_path, destination_path):
    """Create a link from source_path to destination path unless
    one already exists.  If it exists but is different then the
    arguments imply an exception is raised."""

    destination_dir = os.path.dirname(destination_path)
    if not os.path.isdir(destination_dir):
        os.makedirs(destination_dir)
    if os.path.exists(destination_path):
        if (
            os.path.islink(destination_path)
            and os.path.realpath(destination_path) == source_path
        ):
            if args.verbose:
                print(f"  Skip {source_path} -> {destination_path}")
            return
        else:
            raise Exception(f"File {destination_path} already exists")
    os.symlink(source_path, destination_path)
    if args.verbose:
        print(f"  Link {source_path} -> {destination_path}")
Create a link from source_path to destination path unless
    one already exists.  If it exists but is different then the
    arguments imply an exception is raised.
Create a link from source_path to destination path unless
one already exists.  If it exists but is different then the
arguments imply an exception is raised.
Create a link from source_path to destination path unless one already exists . If it exists but is different then the arguments imply an exception is raised .
def link_files(source_path, destination_path):
    destination_dir = os.path.dirname(destination_path)
    if not os.path.isdir(destination_dir):
        os.makedirs(destination_dir)
    if os.path.exists(destination_path):
        if (
            os.path.islink(destination_path)
            and os.path.realpath(destination_path) == source_path
        ):
            if args.verbose:
                print(f"  Skip {source_path} -> {destination_path}")
            return
        else:
            raise Exception(f"File {destination_path} already exists")
    os.symlink(source_path, destination_path)
    if args.verbose:
        print(f"  Link {source_path} -> {destination_path}")
def link_files ( source_path , destination_path ) : destination_dir = os . path . dirname ( destination_path ) if not os . path . isdir ( destination_dir ) : os . makedirs ( destination_dir ) if os . path . exists ( destination_path ) : if ( os . path . islink ( destination_path ) and os . path . realpath ( destination_path ) == source_path ) : if args . verbose : print ( f"  Skip {source_path} -> {destination_path}" ) return else : raise Exception ( f"File {destination_path} already exists" ) os . symlink ( source_path , destination_path ) if args . verbose : print ( f"  Link {source_path} -> {destination_path}" )
Create a link from source_path to destination path unless
one already exists.
Create a link from source_path to destination path unless one already exists .
"""Create a link from source_path to destination path unless
    one already exists.  If it exists but is different then the
    arguments imply an exception is raised."""
source_path
destination_path