Skip to content

Commit

Permalink
[110_set_custom_property_path_improvement], issue - #110, Improved th…
Browse files Browse the repository at this point in the history
…e set_custom_property_path method by adding check on the module existence
  • Loading branch information
lelaus committed Nov 22, 2023
1 parent 16ea92f commit cf3b0d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lbh15/_lbh15.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import inspect
import importlib
import os.path
import platform
import copy
from abc import ABC
Expand Down Expand Up @@ -330,6 +331,12 @@ def set_custom_properties_path(cls, file_path: str) -> None:
file_path : str
absolute path of the file where custom properties are implemented
"""
# Exit if the file passed as argument does not exist
if (not os.path.isfile(file_path)):
warnings.warn(f"'{file_path}' provided file not found!"
"\nPlease check the file path and try again!"
"\nNo custom property added.", stacklevel=5)
return
char = '/' if 'Linux' in platform.system() else '\\'
res = file_path.split(char)
file_name = res[-1][:-3]
Expand Down

0 comments on commit cf3b0d9

Please sign in to comment.