util: clean paths code
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
parent
9fd8c7d6af
commit
368e4683d6
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue