Commit d7249ffa authored by Saul Ibarra's avatar Saul Ibarra

Fixes for running 'frozen'


- Replace sys.stdout and sys.stderr with a regular file
- Look for XML schemas in the resources directory
parent 42c4dfe2
...@@ -20,6 +20,11 @@ if os.path.basename(script_dir)=='bin' and os.path.exists(os.path.join(parent_di ...@@ -20,6 +20,11 @@ if os.path.basename(script_dir)=='bin' and os.path.exists(os.path.join(parent_di
sys.path.insert(position, parent_dir) sys.path.insert(position, parent_dir)
if getattr(sys, 'frozen', False):
# Override stdout and stderr, save output to a file
sys.stdout = sys.stderr = open(sys.executable + '.log', 'a')
if __name__ == '__main__': if __name__ == '__main__':
from blink import Blink from blink import Blink
blink = Blink() blink = Blink()
......
...@@ -147,6 +147,11 @@ class Blink(QApplication): ...@@ -147,6 +147,11 @@ class Blink(QApplication):
Group.register_extension(GroupExtension) Group.register_extension(GroupExtension)
SIPSimpleSettings.register_extension(SIPSimpleSettingsExtension) SIPSimpleSettings.register_extension(SIPSimpleSettingsExtension)
if getattr(sys, 'frozen', False):
from blink.resources import Resources
from sipsimple.payloads import XMLDocument
XMLDocument.schema_path = Resources.get('xml-schemas')
notification_center = NotificationCenter() notification_center = NotificationCenter()
notification_center.add_observer(self, sender=self.sip_application) notification_center.add_observer(self, sender=self.sip_application)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment