diff options
author | Kali Kaneko <kali@leap.se> | 2016-03-24 19:10:24 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-03-24 19:10:24 -0400 |
commit | ae5663769f2231f51b1cf2682bc6b6039dc0ab13 (patch) | |
tree | 8afe206a59a60deb64d138324615e427a13a80d1 /src/leap | |
parent | 8ab91a80f1c0ef4e49f682342e9479d140f55c9a (diff) |
[feature] pass the path to pixelated_www package
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/bitmask/pix.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/bitmask/pix.py b/src/leap/bitmask/pix.py index 96ca4299..8242255c 100644 --- a/src/leap/bitmask/pix.py +++ b/src/leap/bitmask/pix.py @@ -19,6 +19,7 @@ Pixelated plugin integration. """ import json import os +import sys from twisted.internet import defer from twisted.python import log @@ -26,6 +27,8 @@ from twisted.python import log from leap.bitmask.util import get_path_prefix from leap.mail.imap.account import IMAPAccount +import pixelated_www + from pixelated.adapter.mailstore import LeapMailStore from pixelated.adapter.welcome_mail import add_welcome_mail from pixelated.application import SingleUserServicesFactory @@ -49,12 +52,19 @@ def start_pixelated_user_agent(userid, soledad, keymanager): services_factory = SingleUserServicesFactory( UserAgentMode(is_single_user=True)) - resource = RootResource(services_factory) + if getattr(sys, 'frozen', False): + # we are running in a |PyInstaller| bundle + static_folder = os.path.join(sys._MEIPASS, 'pixelated_www') + else: + static_folder = os.path.abspath(pixelated_www.__path__) + + resource = RootResource(services_factory, static_folder=static_folder) + + config.host = 'localhost' config.port = 9090 config.sslkey = None config.sslcert = None - config.host = 'localhost' deferred = _start_in_single_user_mode( leap_session, config, |