electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 819c3b81e31f569f9e7287196c92103fc8a79269
parent 7ea01e9e913196790ceb1d814253aab57bdb9df4
Author: ThomasV <thomasv@electrum.org>
Date:   Sat,  2 Feb 2019 06:26:47 +0100

Merge pull request #5055 from SomberNight/fix_qt_icons_when_pkg_installed

fix: qt icons not available when installed as python package
Diffstat:
Aelectrum/gui/icons | 2++
Melectrum/gui/qt/util.py | 2+-
Melectrum/util.py | 6+++---
Msetup.py | 5++++-
4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/electrum/gui/icons b/electrum/gui/icons @@ -0,0 +1 @@ +../../icons/+ \ No newline at end of file diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py @@ -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) diff --git a/electrum/util.py b/electrum/util.py @@ -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): diff --git a/setup.py b/setup.py @@ -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,