Example #1
0
def get_common_documents_dir():
    if sys.platform == "win32":
        path = fsboot.csidl_dir(CSIDL_COMMON_DOCUMENTS)
    else:
        raise NotImplementedError("Only for windows")
    path = unicode_path(path)
    return path
Example #2
0
def get_pictures_dir(allow_create=True):
    if sys.platform == "win32":
        path = fsboot.csidl_dir(CSIDL_MYPICTURES)
    else:
        path = xdg_user_dir("PICTURES")
        if not path:
            path = os.path.join(get_home_dir(), "Pictures")
    path = unicode_path(path)
    if allow_create and not os.path.isdir(path):
        os.makedirs(path)
    return path
Example #3
0
def get_desktop_dir(allow_create=True):
    if sys.platform == "win32":
        path = fsboot.csidl_dir(fsboot.CSIDL_DESKTOP)
    else:
        path = xdg_user_dir("DESKTOP")
        if not path:
            path = os.path.join(get_home_dir(), "Desktop")
    path = unicode_path(path)
    if allow_create and not os.path.isdir(path):
        os.makedirs(path)
    return path