Merge pull request #5055 from SomberNight/fix_qt_icons_when_pkg_installed

fix: qt icons not available when installed as python package
This commit is contained in:
ThomasV 2019-02-02 06:26:47 +01:00 committed by GitHub
commit 819c3b81e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

1
electrum/gui/icons Symbolic link
View file

@ -0,0 +1 @@
../../icons/

View file

@ -797,7 +797,7 @@ def get_parent_main_window(widget):
def icon_path(icon_basename):
return resource_path('icons', icon_basename)
return resource_path('gui', 'icons', icon_basename)
@lru_cache(maxsize=1000)

View file

@ -490,11 +490,11 @@ def user_dir():
def resource_path(*parts):
return os.path.join(base_dir, *parts)
return os.path.join(pkg_dir, *parts)
# absolute path to project root dir when running from source
base_dir = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]
# absolute path to python package folder of electrum ("lib")
pkg_dir = os.path.split(os.path.realpath(__file__))[0]
def is_valid_email(s):

View file

@ -47,7 +47,7 @@ if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
usr_share = os.path.expanduser('~/.local/share')
data_files += [
(os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
(os.path.join(usr_share, icons_dirname), ['icons/electrum.png'])
(os.path.join(usr_share, icons_dirname), ['icons/electrum.png']),
]
extras_require = {
@ -79,6 +79,9 @@ setup(
'wordlist/*.txt',
'locale/*/LC_MESSAGES/electrum.mo',
],
'electrum.gui': [
'icons/*',
],
},
scripts=['electrum/electrum'],
data_files=data_files,