This commit is contained in:
Marc Beninca 2024-02-16 21:31:38 +01:00
parent ee53cf87db
commit 5112761af5
7 changed files with 14 additions and 11 deletions

View file

@ -1,5 +1,5 @@
from ... import cmd
from ... import ps
import cmd
import ps
cmd.need('debootstrap')

View file

@ -1,5 +1,5 @@
from ... import cmd
from ... import ps
import cmd
import ps
cmd.need('mksquashfs')

View file

@ -2,7 +2,7 @@ import os
import shutil
import subprocess
from .. import ps
import ps
CHARSET = 'UTF-8'

View file

@ -1,4 +1,7 @@
from .. import ps
import cmd
import ps
cmd.need('grub-mkimage')
COMPRESSION = 'xz'
ENV_BYTES = 1024

View file

@ -10,4 +10,4 @@ class Project:
def from_root_file(file_path: str):
project_file = os.path.realpath(file_path)
project_root = os.path.dirname(project_file)
return Project(real_file)
return Project(project_root)

View file

@ -1,6 +1,6 @@
import subprocess
from .. import txt
import txt
def get_tuples_args(tuples) -> list[str]:
@ -17,12 +17,12 @@ def run(*tuples) -> subprocess.CompletedProcess:
return subprocess.run(get_tuples_args(tuples), capture_output=False)
def run_line(*tuples, charset:str=txt.CHARSET) -> str:
def run_line(*tuples, charset:str = txt.CHARSET) -> str:
lines = run_lines(*get_tuples_args(tuples), charset=charset)
return lines[0]
def run_lines(*tuples, charset:str=txt.CHARSET) -> list[str]:
def run_lines(*tuples, charset:str = txt.CHARSET) -> list[str]:
process = subprocess.run(get_tuples_args(tuples), capture_output=True)
string = process.stdout.decode(charset)
return string.rstrip().splitlines()

View file

@ -1 +1 @@
CHARSET='UTF-8'
CHARSET = 'UTF-8'