1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-23 06:33:11 +02:00

Added zoomed in snapshot for peek scripts

This commit is contained in:
Thomas Bui
2020-12-28 18:32:49 -08:00
parent 4ec9d85805
commit eb6884db84
15 changed files with 159 additions and 28 deletions

View File

@@ -145,3 +145,18 @@ def rename_extracted_files(extract_path: str):
os.replace(dict_["old"], dict_["new"])
print("Files renamed")
def create_screenshot_folder(dir, screenshot_name: str="screenshots"):
"""
Create a screenshots folder in the dir.
:param dir, the dir where we want to create the folder.
:param screenshot_name, the name of the screenshot folder.
:raise Exception if the dir provided is not a directory.
:return the string name of the screenshot folder.
"""
folder = Path(dir).resolve()
if not folder.is_dir():
raise Exception(f"This is not a dir: {str(folder)}. \ndir must be a valid directory")
folder.mkdir(screenshot_name, exist_ok=True)
return str(folder)