MiScanUtils¶
Module contents¶
-
MiScan.utils.
exists_or_mkdir
(path, verbose=False)¶ Check a folder by given name, if not exist, create the folder and return False, if directory exists, return True. :param path: A folder path. :type path: str :param verbose: If True (default), prints results. :type verbose: boolean
Returns: True if folder already exist, otherwise, returns False and create the folder. Return type: boolean
-
MiScan.utils.
file_exists
(filepath)¶ Check whether a file exists by given file path.
-
MiScan.utils.
time_it
(func)¶ time record decorator
Parameters: func – Returns: wrapper function, callable
-
MiScan.utils.
get_data
()¶ get dependency data config
Returns: dict
-
MiScan.utils.
check_file
(path, verbose=True)¶ Check a file by given name, if exist, then delete and return 0, else, return 1. :param path: A file path. :type path: str :param verbose: If True (default), prints results. :type verbose: boolean
Returns: 0 if file already exist and delete the file, otherwise, returns 1. Return type: int