How to use the appdirs._get_win_folder function in appdirs

To help you get started, we’ve selected a few appdirs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ssec / sift / uwsift / util / default_paths.py View on Github external
def _desktop_directory():
    try:
        if sys.platform.startswith('win'):
            import appdirs
            # https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx
            return appdirs._get_win_folder('CSIDL_DESKTOPDIRECTORY')
        else:
            return os.path.join(os.path.expanduser('~'), 'Desktop')
    except (KeyError, ValueError):
        return os.getcwd()

appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

MIT
Latest version published 4 years ago

Package Health Score

77 / 100
Full package analysis

Similar packages