Example #1
0
    def get_default_state_dir(home_dir_postfix=u'.Tribler'):
        """Get the default application state directory."""
        if 'TSTATEDIR' in os.environ:
            return os.environ['TSTATEDIR']

        if os.path.isdir(home_dir_postfix):
            return os.path.abspath(home_dir_postfix)

        application_directory = get_appstate_dir()
        return os.path.join(application_directory, home_dir_postfix)
Example #2
0
    def get_default_state_dir(home_dir_postfix=u'.Tribler'):
        """Get the default application state directory."""
        if 'TSTATEDIR' in os.environ:
            return os.environ['TSTATEDIR']

        if os.path.isdir(home_dir_postfix):
            return os.path.abspath(home_dir_postfix)

        application_directory = get_appstate_dir()
        return os.path.join(application_directory, home_dir_postfix)
Example #3
0
    def get_default_state_dir(home_dir_postfix=u'.Tribler'):
        """Get the default application state directory."""
        state_directory_variable = u'${TSTATEDIR}'
        state_directory = os.path.expandvars(state_directory_variable)
        if state_directory and state_directory != state_directory_variable:
            return state_directory

        if os.path.isdir(home_dir_postfix):
            return os.path.abspath(home_dir_postfix)

        application_directory = get_appstate_dir()
        return os.path.join(application_directory, home_dir_postfix)
Example #4
0
    def get_default_state_dir(homedirpostfix=u'.Tribler'):
        # Allow override
        statedirvar = u'${TSTATEDIR}'
        statedir = os.path.expandvars(statedirvar)
        if statedir and statedir != statedirvar:
            return statedir

        if os.path.isdir(homedirpostfix):
            return os.path.abspath(homedirpostfix)

        appdir = get_appstate_dir()
        return os.path.join(appdir, homedirpostfix)
Example #5
0
    def get_default_state_dir(homedirpostfix=u'.Tribler'):
        # Allow override
        statedirvar = u'${TSTATEDIR}'
        statedir = os.path.expandvars(statedirvar)
        if statedir and statedir != statedirvar:
            return statedir

        if os.path.isdir(homedirpostfix):
            return os.path.abspath(homedirpostfix)

        appdir = get_appstate_dir()
        return os.path.join(appdir, homedirpostfix)
Example #6
0
    def get_default_state_dir(homedirpostfix='.Tribler'):
        """ Returns the factory default directory for storing session state
        on the current platform (Win32,Mac,Unix).
        @return An absolute path name. """

        # Allow override
        statedirvar = '${TSTATEDIR}'
        statedir = os.path.expandvars(statedirvar)
        if statedir and statedir != statedirvar:
            return statedir
        
        appdir = get_appstate_dir() 
        statedir = os.path.join(appdir, homedirpostfix)
        return statedir
Example #7
0
    def get_default_state_dir(homedirpostfix=".Tribler"):
        """ Returns the factory default directory for storing session state
        on the current platform (Win32,Mac,Unix).
        @return An absolute path name. """

        # Allow override
        statedirvar = "${TSTATEDIR}"
        statedir = os.path.expandvars(statedirvar)
        if statedir and statedir != statedirvar:
            return statedir

        appdir = get_appstate_dir()
        statedir = os.path.join(appdir, homedirpostfix)
        return statedir
Example #8
0
 def test_appstate_dir(self):
     appstate_dir = get_appstate_dir()
     self.assertIsInstance(appstate_dir, unicode)
     self.assertTrue(os.path.isdir(appstate_dir))
Example #9
0
 def test_appstate_dir(self):
     appstate_dir = get_appstate_dir()
     self.assertIsInstance(appstate_dir, unicode)
     self.assertTrue(os.path.isdir(appstate_dir))
Example #10
0
 def test_appstate_dir(self):
     appstate_dir = get_appstate_dir()
     self.assertIsInstance(appstate_dir, six.text_type)
     self.assertTrue(os.path.isdir(appstate_dir))
Example #11
0
 def test_appstate_dir(self):
     appstate_dir = get_appstate_dir()
     self.assertIsInstance(appstate_dir, six.text_type)
     self.assertTrue(os.path.isdir(appstate_dir))