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)
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)
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)
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
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
def test_appstate_dir(self): appstate_dir = get_appstate_dir() self.assertIsInstance(appstate_dir, unicode) self.assertTrue(os.path.isdir(appstate_dir))
def test_appstate_dir(self): appstate_dir = get_appstate_dir() self.assertIsInstance(appstate_dir, six.text_type) self.assertTrue(os.path.isdir(appstate_dir))