Пример #1
0
def get_favorites():
    """A list of paths of commonly used folders (Desktop,..)

    Paths don't have to exist.
    """

    if os.name == "nt":
        return _get_win_favorites()
    else:
        paths = [get_home_dir()]

        xfg_user_dirs = xdg_get_user_dirs()
        for key in ["XDG_DESKTOP_DIR", "XDG_DOWNLOAD_DIR", "XDG_MUSIC_DIR"]:
            if key in xfg_user_dirs:
                path = xfg_user_dirs[key]
                if path not in paths:
                    paths.append(path)

        return paths
Пример #2
0
def get_favorites():
    """A list of paths of commonly used folders (Desktop,..)

    Paths don't have to exist.
    """

    if os.name == "nt":
        return _get_win_favorites()
    else:
        paths = [get_home_dir()]

        xfg_user_dirs = xdg_get_user_dirs()
        for key in ["XDG_DESKTOP_DIR", "XDG_DOWNLOAD_DIR", "XDG_MUSIC_DIR"]:
            if key in xfg_user_dirs:
                path = xfg_user_dirs[key]
                if path not in paths:
                    paths.append(path)

        return paths
Пример #3
0
 def test_get_user_dirs(self):
     xdg_get_user_dirs()
Пример #4
0
 def test_get_user_dirs(self):
     xdg_get_user_dirs()