honeybee_plus.futil module¶
A collection of auxiliary functions for working with files and directories.
-
honeybee_plus.futil.
bat_to_sh
(file_path)[source]¶ Convert honeybee .bat file to .sh file.
WARNING: This is a very simple function and doesn’t handle any edge cases.
-
honeybee_plus.futil.
copy_files_to_folder
(files, target_folder, overwrite=True)[source]¶ Copy a list of files to a new target folder.
- Returns
A list of fullpath of the new files.
-
honeybee_plus.futil.
normspace
(path)[source]¶ Norm white spaces in path.
Return path with quotation marks if there is whitespace in path.
-
honeybee_plus.futil.
nukedir
(target_dir, rmdir=False)[source]¶ Delete all the files inside target_dir.
- Usage:
nukedir(“c:/ladybug/libs”, True)
-
honeybee_plus.futil.
preparedir
(target_dir, remove_content=True)[source]¶ Prepare a folder for analysis.
This method creates the folder if it is not created, and removes the file in the folder if the folder already existed.
-
honeybee_plus.futil.
write_to_file
(file_path, data, mkdir=False)[source]¶ Write a string of data to file.
- Parameters
file_path – Full path for a valid file path (e.g. c:/ladybug/testPts.pts)
data – Any data as string
mkdir – Set to True to create the directory if doesn’t exist (Default: False)
-
honeybee_plus.futil.
write_to_file_by_name
(folder, fname, data, mkdir=False)[source]¶ Write a string of data to file by filename and folder.
- Parameters
folder – Target folder (e.g. c:/ladybug).
fname – File name (e.g. testPts.pts).
data – Any data as string.
mkdir – Set to True to create the directory if doesn’t exist (Default: False).