lint fs
This commit is contained in:
parent
c7db231dc2
commit
592023d214
1 changed files with 10 additions and 10 deletions
|
@ -3,13 +3,13 @@ import shutil
|
|||
|
||||
from rwx import ps
|
||||
|
||||
CHARSET = 'UTF-8'
|
||||
CHARSET = "UTF-8"
|
||||
|
||||
|
||||
def create_image(file_path: str, size_bytes: int):
|
||||
ps.run(
|
||||
('qemu-img', 'create'),
|
||||
('-f', 'qcow2'),
|
||||
("qemu-img", "create"),
|
||||
("-f", "qcow2"),
|
||||
(file_path, size_bytes),
|
||||
)
|
||||
|
||||
|
@ -20,17 +20,17 @@ def empty_file(path: str):
|
|||
|
||||
def get_mount_uuid(path: str):
|
||||
return ps.run_line(
|
||||
('findmnt',),
|
||||
('--noheadings',),
|
||||
('--output', 'UUID'),
|
||||
("findmnt",),
|
||||
("--noheadings",),
|
||||
("--output", "UUID"),
|
||||
(path,),
|
||||
)
|
||||
|
||||
|
||||
def get_path_mount(path: str):
|
||||
return ps.run_line(
|
||||
('stat',),
|
||||
('--format', '%m'),
|
||||
("stat",),
|
||||
("--format", "%m"),
|
||||
(path,),
|
||||
)
|
||||
|
||||
|
@ -44,7 +44,7 @@ def make_directory(path: str):
|
|||
|
||||
|
||||
def read_file(file_path: str):
|
||||
with open(file_path, 'br') as file_object:
|
||||
with open(file_path, "br") as file_object:
|
||||
return file_object.read()
|
||||
|
||||
|
||||
|
@ -66,5 +66,5 @@ def wipe(path: str):
|
|||
|
||||
|
||||
def write(file_path: str, text: str, charset=CHARSET):
|
||||
with open(file_path, 'bw') as file_object:
|
||||
with open(file_path, "bw") as file_object:
|
||||
file_object.write(text.encode(charset))
|
||||
|
|
Loading…
Reference in a new issue