mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 01:34:15 +02:00
Working with local resources path
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import os
|
||||
import getpass
|
||||
|
||||
local_resource_path = '/home/{}/.local/share/fpakman/resources'.format(getpass.getuser())
|
||||
app_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
def get_path(resource_path):
|
||||
app_dir = get_app_dir()
|
||||
return app_dir + '/resources/' + resource_path
|
||||
|
||||
|
||||
def get_app_dir():
|
||||
return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if os.path.exists(local_resource_path):
|
||||
return local_resource_path + resource_path
|
||||
else:
|
||||
return app_dir + '/resources/' + resource_path
|
||||
|
||||
Reference in New Issue
Block a user