util: clean paths code
continuous-integration/drone/push Build was killed Details

master
pictuga 2021-12-16 08:53:18 +00:00
parent 9fd8c7d6af
commit 368e4683d6
1 changed files with 5 additions and 5 deletions

View File

@ -34,17 +34,17 @@ def data_path(path=''):
bases = [ bases = [
os.path.join(sys.prefix, 'share/morss/www'), os.path.join(sys.prefix, 'share/morss/www'),
os.path.join(pkg_path(), '../../../share/morss/www'), pkg_path('../../../share/morss/www'),
os.path.join(pkg_path(), '../../../../share/morss/www'), pkg_path('../../../../share/morss/www'),
os.path.join(pkg_path(), '../www'), pkg_path('../www'),
os.path.join(pkg_path(), '../..') pkg_path('../..')
] ]
for base in bases: for base in bases:
full_path = os.path.join(base, path) full_path = os.path.join(base, path)
if os.path.isfile(full_path): if os.path.isfile(full_path):
data_path_base = base data_path_base = os.path.abspath(base)
return data_path(path) return data_path(path)
else: else: