feat: printing utils
This commit is contained in:
+25
-5
@@ -1,11 +1,31 @@
|
||||
from typing import List
|
||||
from commands.util import pacman
|
||||
from commands.util.input_mgr import confirm_overwrite, password
|
||||
import colorama as cl
|
||||
|
||||
from commands.util.printer import print_list
|
||||
|
||||
|
||||
def commit(dry_run: bool = False, force: bool = False, no_render: bool = False):
|
||||
if dry_run:
|
||||
pass
|
||||
def commit(force: bool = False, no_render: bool = False):
|
||||
print("Commit, force:", force)
|
||||
password()
|
||||
print(pacman.list_explicitly_installed())
|
||||
# TODO: Make sure we don't uninstall critical system packages by accident (i.e. prompt user)
|
||||
# Probably do that check in the pacman util lib tho
|
||||
# pw = password()
|
||||
print_diff(pacman.list_explicitly_installed(), [])
|
||||
print(confirm_overwrite())
|
||||
|
||||
|
||||
def print_diff(add: List[str], remove: List[str]):
|
||||
print(
|
||||
cl.Fore.GREEN + "==>",
|
||||
cl.Style.RESET_ALL + "Packages that will be",
|
||||
cl.Fore.GREEN + "installed" + cl.Style.RESET_ALL,
|
||||
)
|
||||
|
||||
print_list(add)
|
||||
|
||||
print(
|
||||
cl.Fore.GREEN + "==>",
|
||||
cl.Style.RESET_ALL + "Packages that will be",
|
||||
cl.Fore.RED + "uninstalled" + cl.Style.RESET_ALL,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user