from libs.spk_v.runtime import SPK_runtime, SPKRPkgTask
from libs.spk_v.tkmg import VTask


class OSPkgTask(VTask):
    def __init__(self, action, target, target_args=None):
        self.action = action
        self.target = target
        self.target_args = target_args

        super().__init__()
        super().init()
    def run(self, task_manager, app):
        if self.action == 'install':
            app.osa.packages.install(self.target)
        if self.action == 'remove':
            app.osa.packages.remove(self.target)

