Skip to content
Snippets Groups Projects
Commit 5ed5b3ac authored by benjamin.jakimow@geo.hu-berlin.de's avatar benjamin.jakimow@geo.hu-berlin.de
Browse files

added findAbsolutePath(), which looks in some reasonable directories to resolve relative paths

parent 18d2507d
No related branches found
No related tags found
No related merge requests found
......@@ -44,5 +44,15 @@ def file_search(rootdir, wildcard, recursive=False, ignoreCase=False):
results.append(os.path.join(root, file))
if not recursive:
break
pass
return results
def findAbsolutePath(file):
if os.path.exists(file): return file
possibleRoots = [DIR_EXAMPLES, DIR_REPO, os.getcwd()]
for root in possibleRoots:
tmp = jp(root, file)
if os.path.exists(tmp):
return tmp
return None
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment