Ejemplo n.º 1
0
    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.')
Ejemplo n.º 2
0
 def install_and_stream(self, app: FlatpakApplication, root_password: str) -> BauhProcess:
     return BauhProcess(subproc=flatpak.install_and_stream(app.base_data.id, app.origin))
Ejemplo n.º 3
0
 def uninstall_and_stream(self, app: FlatpakApplication, root_password: str = None) -> BauhProcess:
     return BauhProcess(subproc=flatpak.uninstall_and_stream(app.ref))
Ejemplo n.º 4
0
 def update_and_stream(self, app: FlatpakApplication) -> BauhProcess:
     return BauhProcess(subproc=flatpak.update_and_stream(app.ref))
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 def refresh(self, app: SnapApplication, root_password: str) -> BauhProcess:
     return BauhProcess(
         subproc=snap.refresh_and_stream(app.base_data.name, root_password))
Ejemplo n.º 7
0
 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))