make utils.project.data_path return path unmodified when outside project

This commit is contained in:
Elias Dorneles 2015-11-03 15:46:05 -02:00
parent 86eb865598
commit 8e4947ef0d
1 changed files with 3 additions and 3 deletions

View File

@ -40,10 +40,10 @@ def project_data_dir(project='default'):
return d
def data_path(path, createdir=False):
"""If path is relative, return the given path inside the project data dir,
otherwise return the path unmodified
"""If inside the project and path is relative, return the given path
as relative the project data dir, otherwise return it unmodified
"""
if not isabs(path):
if inside_project() and not isabs(path):
path = join(project_data_dir(), path)
if createdir and not exists(path):
os.makedirs(path)