def initialize_gui(self): if self.gui_initialized: return True # Set path for gui settings to default user data according to the # OpenSlides type. This does not depend on any argument the user might # type in. openslides_type = detect_openslides_type() try: default_user_data_path = get_default_user_data_dir(openslides_type) except PortableDirNotWritable: wx.MessageBox( _("The portable directory is not writable. Please copy the " "openslides portable to a writeable location and start it " "again from there"), _("Error: Portable directory not writable"), wx.OK | wx.ICON_ERROR) return False self.gui_settings_path = os.path.join(default_user_data_path, 'openslides', 'gui_settings.json') self.load_gui_settings() self.apply_backup_settings() self.gui_initialized = True return True
def test_get_default_user_data_dir(self): self.assertIn( os.path.join(".local", "share"), main.get_default_user_data_dir(main.UNIX_VERSION), )
def test_get_default_user_data_dir(self): self.assertIn(os.path.join('.local', 'share'), main.get_default_user_data_dir(main.UNIX_VERSION))