[Pkg-privacy-commits] [onionshare] 82/256: Update helpers.get_resource_path to correctly find resources in frozen macOS app bundles

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to branch master
in repository onionshare.

commit 6f5a3aedbb3c425708d7905596f5e1f352aac70e
Author: Micah Lee <micah at micahflee.com>
Date:   Tue Feb 21 14:34:34 2017 -0800

    Update helpers.get_resource_path to correctly find resources in frozen macOS app bundles
---
 onionshare/helpers.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/onionshare/helpers.py b/onionshare/helpers.py
index 832f2f3..1ba21ed 100644
--- a/onionshare/helpers.py
+++ b/onionshare/helpers.py
@@ -42,9 +42,14 @@ def get_resource_path(filename):
     elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
         # OnionShare is installed systemwide in Linux
         resources_dir = os.path.join(sys.prefix, 'share/onionshare')
-    elif getattr(sys, 'frozen', False): # Check if app is "frozen" with cx_Freeze
-        # http://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files
-        resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
+
+    elif getattr(sys, 'frozen', False):
+        # Check if app is "frozen"
+        # https://pythonhosted.org/PyInstaller/#run-time-information
+        if p == 'Darwin':
+            resources_dir = sys._MEIPASS
+        elif p == 'Windows':
+            resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
 
     return os.path.join(resources_dir, filename)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list