def install_app(self, app: ApplicationView): pwd = None requires_root = self.manager.requires_root('install', app.model) if not is_root() and requires_root: pwd, ok = ask_root_password(self.locale_keys) if not ok: return self._handle_console_option(True) self._begin_action('{} {}'.format( self.locale_keys['manage_window.status.installing'], app.model.base_data.name)) self.thread_install.app = app self.thread_install.root_password = pwd self.thread_install.start()
def downgrade_app(self, app: ApplicationView): pwd = None requires_root = self.manager.requires_root( 'downgrade', self.table_apps.get_selected_app().model) if not is_root() and requires_root: pwd, ok = ask_root_password(self.locale_keys) if not ok: return self._handle_console_option(True) self._begin_action('{} {}'.format( self.locale_keys['manage_window.status.downgrading'], app.model.base_data.name)) self.thread_downgrade.app = app self.thread_downgrade.root_password = pwd self.thread_downgrade.start()