예제 #1
0
    def getUserAppDataDirectory( cls ):
        """Retrieve user-specific configuration directory

        Default implementation gives a directory-name in the
        user's (system-specific) "application data" directory
        named
        """
        from OpenGLContext.browser import homedirectory
        base = homedirectory.appdatadirectory()
        if sys.platform == 'win32':
            name = cls.getApplicationName()
        else:
            # use a hidden directory on non-win32 systems
            # as we are storing in the user's home directory
            name = '.%s'%( cls.getApplicationName())
        path = os.path.join(
            base,
            name,
        )
        if not os.path.isdir( path ):
            os.makedirs( path, mode=0770 )
        return path
예제 #2
0
    def getUserAppDataDirectory(cls):
        """Retrieve user-specific configuration directory

        Default implementation gives a directory-name in the
        user's (system-specific) "application data" directory
        named
        """
        from OpenGLContext.browser import homedirectory
        base = homedirectory.appdatadirectory()
        if sys.platform == 'win32':
            name = cls.getApplicationName()
        else:
            # use a hidden directory on non-win32 systems
            # as we are storing in the user's home directory
            name = '.%s' % (cls.getApplicationName())
        path = os.path.join(
            base,
            name,
        )
        if not os.path.isdir(path):
            os.makedirs(path, mode=0770)
        return path