File Handler
This module contains functions to handle files and folders.
ATTRIBUTE | DESCRIPTION |
---|---|
TEMP_ZIP |
temporary zip file path
TYPE:
|
FUNCTION | DESCRIPTION |
---|---|
create_folder |
Check and create folder if it does not exist |
init |
Add repository to sys.path, and get machine id and connected ports |
read_config_file |
Read configuration file and return as dictionary |
readable_duration |
Display time duration (s) as HH:MM:SS text |
resolve_repo_filepath |
Resolve relative path to absolute path |
start_project_here |
Create new project in destination directory |
zip_files |
Zip files and return zip file path |
Documentation last updated: 2025-06-11
create_folder
Check and create folder if it does not exist
PARAMETER | DESCRIPTION |
---|---|
base
|
parent folder directory. Defaults to ''.
TYPE:
|
sub
|
child folder directory. Defaults to ''.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
name of main folder
TYPE:
|
init
Add repository to sys.path
, and getting machine id and connected ports
PARAMETER | DESCRIPTION |
---|---|
repository
|
name of current repository, or path to repository folder
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
target directory path
TYPE:
|
read_config_file
Read configuration file and return as dictionary
PARAMETER | DESCRIPTION |
---|---|
filepath
|
path to configuration file
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
configuration file as dictionary
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
Unsupported file type |
readable_duration
Display time duration (s) as HH:MM:SS text
PARAMETER | DESCRIPTION |
---|---|
total_time
|
duration in seconds
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
formatted time string
TYPE:
|
resolve_repo_filepath
Resolve relative path to absolute path
PARAMETER | DESCRIPTION |
---|---|
filepath
|
relative path to file
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
absolute path to file
TYPE:
|
start_project_here
Create new project in destination directory. If destination is not provided, create in current directory
PARAMETER | DESCRIPTION |
---|---|
dst
|
destination folder. Defaults to None.
TYPE:
|
zip_files
Zip files and return zip file path
PARAMETER | DESCRIPTION |
---|---|
filepaths
|
list of file paths
TYPE:
|
zip_filepath
|
zip file path. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
zip file path
TYPE:
|