Return 2-Tuple (from_custom, from_default) for a given path.

    Example:

        >>> FABSETUP_CUSTOM_DIR = '/home/theno/.fabsetup-custom'
        >>>
        >>> # path is an abpath
        ...
        >>> addon_package = AddonPackage(module_dir='/home/theno/'
        ...                              '.fabsetup-addon-repos/'
        ...                              'fabsetup-theno-termdown/'
        ...                              'fabsetup_theno_termdown')
        >>> _determine_froms(addon_package, path='/absolute/path/foo.bar')
        ('/home/theno/.fabsetup-custom/fabsetup-theno-termdown/files/absolute/path/foo.bar', '/home/theno/.fabsetup-addon-repos/fabsetup-theno-termdown/fabsetup_theno_termdown/files/absolute/path/foo.bar')
        >>>
        >>> # with home-dir expansion
        ...
        >>> addon_package = AddonPackage(module_dir='/home/theno/'
        ...                              '.fabsetup-addon-repos/'
        ...                              'fabsetup-theno-termdown/'
        ...                              'fabsetup_theno_termdown')
        >>> _determine_froms(addon_package, path='~/foo/bar.baz')
        ('/home/theno/.fabsetup-custom/fabsetup-theno-termdown/files/home/USERNAME/foo/bar.baz', '/home/theno/.fabsetup-addon-repos/fabsetup-theno-termdown/fabsetup_theno_termdown/files/home/USERNAME/foo/bar.baz')

def _determine_froms(addon_package, path):
    '''Return 2-Tuple (from_custom, from_default) for a given path.

    Example:

        >>> FABSETUP_CUSTOM_DIR = '/home/theno/.fabsetup-custom'
        >>>
        >>> # path is an abpath
        ...
        >>> addon_package = AddonPackage(module_dir='/home/theno/'
        ...                              '.fabsetup-addon-repos/'
        ...                              'fabsetup-theno-termdown/'
        ...                              'fabsetup_theno_termdown')
        >>> _determine_froms(addon_package, path='/absolute/path/foo.bar')
        ('/home/theno/.fabsetup-custom/fabsetup-theno-termdown/files/absolute/path/foo.bar', '/home/theno/.fabsetup-addon-repos/fabsetup-theno-termdown/fabsetup_theno_termdown/files/absolute/path/foo.bar')
        >>>
        >>> # with home-dir expansion
        ...
        >>> addon_package = AddonPackage(module_dir='/home/theno/'
        ...                              '.fabsetup-addon-repos/'
        ...                              'fabsetup-theno-termdown/'
        ...                              'fabsetup_theno_termdown')
        >>> _determine_froms(addon_package, path='~/foo/bar.baz')
        ('/home/theno/.fabsetup-custom/fabsetup-theno-termdown/files/home/USERNAME/foo/bar.baz', '/home/theno/.fabsetup-addon-repos/fabsetup-theno-termdown/fabsetup_theno_termdown/files/home/USERNAME/foo/bar.baz')

    '''
    # from_tail
    if path.startswith('~/'):
        path_tail = path[2:]  # path without beginning '~/'
        from_tail = join('home', 'USERNAME', path_tail)
    else:
        # remove beginning '/' (if any), eg '/foo/bar' -> 'foo/bar'
        from_tail = path.lstrip(os.sep)

    from_default = join(addon_package.default_files_basedir, from_tail)
    from_custom = join(addon_package.custom_files_basedir, from_tail)

    return from_custom, from_default