Use pathlib.Path to resolve paths
* is_block_device() is no longer needed * (pathlib.Path provides that functionality)
This commit is contained in:
parent
c4d00a2073
commit
cd0a9456cb
1 changed files with 10 additions and 13 deletions
|
|
@ -1,24 +1,21 @@
|
|||
# Wizard Kit: Functions - UFD
|
||||
|
||||
import pathlib
|
||||
from functions.common import *
|
||||
|
||||
|
||||
def get_full_path(item):
|
||||
"""Get full path to item, returns str."""
|
||||
#TODO
|
||||
pass
|
||||
"""Get full path to item, returns pathlib.Path obj."""
|
||||
path_obj = pathlib.Path(item).resolve()
|
||||
if not path_obj.exists():
|
||||
raise FileNotFoundError(path_obj)
|
||||
|
||||
return path_obj
|
||||
|
||||
|
||||
def is_block_device(item):
|
||||
"""Verify item is a block device, returns bool."""
|
||||
#TODO
|
||||
pass
|
||||
|
||||
|
||||
def is_valid_main_kit(path):
|
||||
"""Verify path contains the main kit, returns bool."""
|
||||
#TODO
|
||||
pass
|
||||
def is_valid_main_kit(path_obj):
|
||||
"""Verify PathObj contains the main kit, returns bool."""
|
||||
return path_obj.is_dir() and path_obj.joinpath('.bin').exists()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue