minor improvements

main
mirkobrombin 2 years ago
parent 13abeb9f68
commit c912f1860c

@ -12,7 +12,9 @@ class Apt:
subprocess.run(
['sudo', 'apt', 'install'] + packages + ['-y'],
env=Apt.env,
check=True
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
@ -20,7 +22,9 @@ class Apt:
subprocess.run(
['sudo', 'apt', 'remove'] + packages + ['-y'],
env=Apt.env,
check=True
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
@ -28,7 +32,9 @@ class Apt:
subprocess.run(
['sudo', 'apt', 'purge'] + packages + ['-y'],
env=Apt.env,
check=True
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
@ -36,7 +42,9 @@ class Apt:
subprocess.run(
['sudo', 'apt', 'update'],
env=Apt.env,
check=True
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
@ -44,5 +52,7 @@ class Apt:
subprocess.run(
['sudo', 'apt', 'upgrade', '-y'],
env=Apt.env,
check=True
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)

@ -1,25 +1,36 @@
import os
import subprocess
class Flatpak:
env = os.environ.copy()
@staticmethod
def install(packages: list):
subprocess.run(
['flatpak', 'install', '--user'] + packages,
check=True
env=Flatpak.env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
def remove(packages: list):
subprocess.run(
['flatpak', 'remove', '--user'] + packages,
check=True
env=Flatpak.env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
def add_repo(repo: str):
subprocess.run(
['flatpak', 'remote-add', '--user', '--if-not-exists', repo],
check=True
env=Flatpak.env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)

@ -1,18 +1,26 @@
import os
import subprocess
class Snap:
env = os.environ.copy()
@staticmethod
def install(packages: list):
subprocess.run(
['snap', 'install'] + packages,
check=True
env=Snap.env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
@staticmethod
def remove(packages: list):
subprocess.run(
['snap', 'remove'] + packages,
check=True
env=Snap.env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)

Loading…
Cancel
Save