def downgrade_app(self, app: FlatpakApplication, root_password: str) -> BauhProcess: commits = flatpak.get_app_commits(app.ref, app.origin) commit_idx = commits.index(app.commit) # downgrade is not possible if the app current commit in the first one: if commit_idx == len(commits) - 1: return None return BauhProcess(subproc=flatpak.downgrade_and_stream(app.ref, commits[commit_idx + 1], root_password), success_phrase='Updates complete.')
def install_and_stream(self, app: FlatpakApplication, root_password: str) -> BauhProcess: return BauhProcess(subproc=flatpak.install_and_stream(app.base_data.id, app.origin))
def uninstall_and_stream(self, app: FlatpakApplication, root_password: str = None) -> BauhProcess: return BauhProcess(subproc=flatpak.uninstall_and_stream(app.ref))
def update_and_stream(self, app: FlatpakApplication) -> BauhProcess: return BauhProcess(subproc=flatpak.update_and_stream(app.ref))
def downgrade_app(self, app: Application, root_password: str) -> BauhProcess: return BauhProcess(subproc=snap.downgrade_and_stream( app.base_data.name, root_password), wrong_error_phrase=None)
def refresh(self, app: SnapApplication, root_password: str) -> BauhProcess: return BauhProcess( subproc=snap.refresh_and_stream(app.base_data.name, root_password))
def install_and_stream(self, app: SnapApplication, root_password: str) -> BauhProcess: return BauhProcess(subproc=snap.install_and_stream( app.base_data.name, app.confinement, root_password))