bootstrap.py
def create_symlinks():
    'Create the symlinks on user home'
    symlinks = glob.glob('*/*.symlink')
    always_overwrite = False

    for symlink in symlinks:
	origin = os.path.join(SELF_PATH, symlink)

        filename = '.' + os.path.splitext(os.path.basename(symlink))[0]
        destine = os.path.expanduser(os.path.join('~', filename))

        if os.path.lexists(destine):

            # Ask the user if overwrite the file
            if not always_overwrite:
                answer = confirm_overwrite(destine)
                always_overwrite = answer == 'a'

            # Remove the file if the user answered yes
            if always_overwrite or answer in ('y', 'a'):
                os.remove(destine)

            # Keep the file if the user answered no
            if answer == 'n':
                continue

        # Create the symlink
        os.symlink(origin, destine)
Create the symlinks on user home
Create the symlinks on user home
Create the symlinks on user home
def create_symlinks():
    symlinks = glob.glob('*/*.symlink')
    always_overwrite = False
    for symlink in symlinks:
	origin = os.path.join(SELF_PATH, symlink)
        filename = '.' + os.path.splitext(os.path.basename(symlink))[0]
        destine = os.path.expanduser(os.path.join('~', filename))
        if os.path.lexists(destine):
            if not always_overwrite:
                answer = confirm_overwrite(destine)
                always_overwrite = answer == 'a'
            if always_overwrite or answer in ('y', 'a'):
                os.remove(destine)
            if answer == 'n':
                continue
        os.symlink(origin, destine)
def create_symlinks ( ) : symlinks = glob . glob ( '*/*.symlink' ) always_overwrite = False for symlink in symlinks : origin = os . path . join ( SELF_PATH , symlink ) filename = '.' + os . path . splitext ( os . path . basename ( symlink ) ) [ 0 ] destine = os . path . expanduser ( os . path . join ( '~' , filename ) ) if os . path . lexists ( destine ) : if not always_overwrite : answer = confirm_overwrite ( destine ) always_overwrite = answer == 'a' if always_overwrite or answer in ( 'y' , 'a' ) : os . remove ( destine ) if answer == 'n' : continue os . symlink ( origin , destine )
Create the symlinks on user home
Create the symlinks on user home
'Create the symlinks on user home' # Ask the user if overwrite the file # Remove the file if the user answered yes # Keep the file if the user answered no # Create the symlink