Skip to content

Commit

Permalink
Merge pull request #15 from Vanilla-OS/image-prep
Browse files Browse the repository at this point in the history
Replace `apx2` with `apx`
  • Loading branch information
matbme authored Jul 25, 2023
2 parents 4ddcda8 + 0935b67 commit 3f63919
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions apx_gui/core/apx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class Apx(ApxEntityBase):

def subsystems_list(self) -> list[Subsystem]:
command = "apx2 subsystems list --json"
command = "apx subsystems list --json"
status, output = self._run_command(command)
if not status:
return []
Expand All @@ -54,7 +54,7 @@ def subsystems_list(self) -> list[Subsystem]:
return subsystems

def stacks_list(self) -> list[Stack]:
command = "apx2 stacks list --json"
command = "apx stacks list --json"
status, output = self._run_command(command)
if not status:
return []
Expand All @@ -75,7 +75,7 @@ def stacks_list(self) -> list[Stack]:
return stacks

def pkgmanagers_list(self) -> list[PkgManager]:
command = "apx2 pkgmanagers list --json"
command = "apx pkgmanagers list --json"
status, output = self._run_command(command)
if not status:
return []
Expand Down
26 changes: 13 additions & 13 deletions apx_gui/core/apx_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ def __init__(
def create(self) -> [bool, "Stack"]:
packages: str = " ".join(self.packages) if isinstance(self.packages, list) else self.packages
command: str = (
f"apx2 stacks new --name {self.name} --base {self.base} --packages \"{packages}\" "
f"apx stacks new --name {self.name} --base {self.base} --packages \"{packages}\" "
f"--pkg-manager {self.pkg_manager} -y"
)
res: [bool, str] = self._run_command(command)
if not res[0]:
return res[0], self

command: str = f"apx2 stacks list --json"
command: str = f"apx stacks list --json"
res: [bool, str] = self._run_command(command)
if not res[0]:
return res[0], self
Expand All @@ -100,13 +100,13 @@ def create(self) -> [bool, "Stack"]:

def update(self, base: str, packages: str, pkg_manager: str) -> [bool, str]:
command: str = (
f"apx2 stacks update --name {self.name} --base {base} --packages \"{packages}\" --pkg-manager {pkg_manager} -y"
f"apx stacks update --name {self.name} --base {base} --packages \"{packages}\" --pkg-manager {pkg_manager} -y"
)
return self._run_command(command)

def remove(self, force: bool = False) -> [bool, str]:
force_flag: str = "--force" if force else ""
command: str = f"apx2 stacks rm {force_flag} --name {self.name}"
command: str = f"apx stacks rm {force_flag} --name {self.name}"
return self._run_command(command)


Expand All @@ -127,12 +127,12 @@ def __init__(
self.exported_programs: Optional[dict] = exported_programs

def create(self) -> [bool, "Subsystem"]:
command: str = f"apx2 subsystems new --name {self.name} --stack {self.stack.name}"
command: str = f"apx subsystems new --name {self.name} --stack {self.stack.name}"
res: [bool, str] = self._run_command(command)
if not res[0]:
return re[0], self

command: str = f"apx2 subsystems list --json"
command: str = f"apx subsystems list --json"
res: [bool, str] = self._run_command(command)
if not res[0]:
return res[0], self
Expand All @@ -148,17 +148,17 @@ def create(self) -> [bool, "Subsystem"]:
return False, self

def update(self, stack: str) -> [bool, str]:
command: str = f"apx2 subsystems update --name {self.name} --stack {stack} -y"
command: str = f"apx subsystems update --name {self.name} --stack {stack} -y"
return self._run_command(command)

def remove(self, force: bool = False) -> [bool, str]:
force_flag: str = "--force" if force else ""
command: str = f"apx2 subsystems rm {force_flag} --name {self.name}"
command: str = f"apx subsystems rm {force_flag} --name {self.name}"
return self._run_command(command)

def reset(self, force: bool = False) -> [bool, str]:
force_flag: str = "--force" if force else ""
command: str = f"apx2 subsystems reset {force_flag} --name {self.name}"
command: str = f"apx subsystems reset {force_flag} --name {self.name}"
return self._run_command(command)


Expand Down Expand Up @@ -196,7 +196,7 @@ def __init__(

def create(self) -> [bool, "PkgManager"]:
command: str = (
f"apx2 pkgmanagers new --name {self.name} --need-sudo {self.need_sudo} "
f"apx pkgmanagers new --name {self.name} --need-sudo {self.need_sudo} "
f"--autoremove {self.cmd_auto_remove} --clean {self.cmd_clean} "
f"--install {self.cmd_install} --list {self.cmd_list} "
f"--purge {self.cmd_purge} --remove {self.cmd_remove} "
Expand All @@ -207,7 +207,7 @@ def create(self) -> [bool, "PkgManager"]:
if not res[0]:
return res[0], self

command: str = f"apx2 pkgmanagers list --json"
command: str = f"apx pkgmanagers list --json"
res: [bool, str] = self._run_command(command)
if not res[0]:
return res[0], self
Expand All @@ -233,5 +233,5 @@ def create(self) -> [bool, "PkgManager"]:

def remove(self, force: bool = False) -> [bool, str]:
force_flag: str = "--force" if force else ""
command: str = f"apx2 pkgmanagers rm {force_flag} --name {self.name}"
return self._run_command(command)
command: str = f"apx pkgmanagers rm {force_flag} --name {self.name}"
return self._run_command(command)
4 changes: 2 additions & 2 deletions apx_gui/widgets/tab_subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def subsystem(self) -> Subsystem:
return self.__subsystem

def __on_console_clicked(self, button: Gtk.Button) -> None:
GLib.spawn_command_line_async(f"kgx -e apx2 {self.__subsystem.name} enter")
GLib.spawn_command_line_async(f"kgx -e apx {self.__subsystem.name} enter")

def __on_reset_clicked(self, button: Gtk.Button) -> None:
def on_callback(result, *args) -> None:
Expand Down Expand Up @@ -117,4 +117,4 @@ def on_response(dialog: Adw.MessageDialog, response: str) -> None:
dialog.add_response("ok", "Delete")
dialog.set_response_appearance("ok", Adw.ResponseAppearance.DESTRUCTIVE)
dialog.connect("response", on_response)
dialog.present()
dialog.present()

0 comments on commit 3f63919

Please sign in to comment.