1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 16:14:45 +00:00
This commit is contained in:
deadc0de6
2023-07-30 22:34:34 +02:00
committed by deadc0de
parent bc70a05ecb
commit 97850a5d93

View File

@@ -266,12 +266,12 @@ class Templategen:
@staticmethod
def path_is_template(path, debug=False):
"""recursively check if any file is a template within path"""
if debug:
LOG.dbg(f'is template: {path}', force=True)
path = os.path.expanduser(path)
if not os.path.exists(path):
# does not exist
if debug:
LOG.dbg(f'is NOT template: \"{path}\"', force=True)
return False
if os.path.isfile(path):
@@ -285,12 +285,18 @@ class Templategen:
# recursively explore directory
if Templategen.path_is_template(fpath,
debug=debug):
if debug:
LOG.dbg(f'is indeed template: \"{path}\"', force=True)
return True
else:
# check if file is a template
if Templategen._is_template(fpath,
debug=debug):
if debug:
LOG.dbg(f'is indeed template: \"{path}\"', force=True)
return True
if debug:
LOG.dbg(f'is NOT template: \"{path}\"', force=True)
return False
@staticmethod