[Pkg-anonymity-tools] [onionshare] 49/57: CLI version of onionshare in OSX now works when symlinked (closes #132)
Ulrike Uhlig
u-guest at moszumanska.debian.org
Tue May 19 18:18:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to annotated tag 0.7
in repository onionshare.
commit ccc8b87b9aed22ea9dd8d1310227b72288f174c2
Author: Micah Lee <micah at micahflee.com>
Date: Fri May 15 19:07:41 2015 -0700
CLI version of onionshare in OSX now works when symlinked (closes #132)
---
install/osx_scripts/onionshare | 3 ++-
onionshare/helpers.py | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/install/osx_scripts/onionshare b/install/osx_scripts/onionshare
index db3f6bc..7253b06 100755
--- a/install/osx_scripts/onionshare
+++ b/install/osx_scripts/onionshare
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import zipimport, os, inspect
cwd = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
-zi = zipimport.zipimporter(cwd+'/lib/python2.7/site-packages.zip')
+os.chdir(cwd)
+zi = zipimport.zipimporter('lib/python2.7/site-packages.zip')
onionshare = zi.load_module('onionshare')
onionshare.main()
diff --git a/onionshare/helpers.py b/onionshare/helpers.py
index c933c97..2379913 100644
--- a/onionshare/helpers.py
+++ b/onionshare/helpers.py
@@ -43,9 +43,11 @@ def get_onionshare_dir():
def get_osx_resources_dir():
if get_platform() == 'Darwin':
- # this is hacky, but in it ultimate ends up returning the absolute path to
+ # this is hacky, but it ultimate ends up returning the absolute path to
# OnionShare.app/Contents/Resources, based on the location of helpers.py
- return os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe())))))
+ helpers_path = os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe())))
+ osx_resources_dir = os.path.dirname(os.path.dirname(helpers_path))
+ return osx_resources_dir
return None
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git
More information about the Pkg-anonymity-tools
mailing list