about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/blink/pythonpath.patch
blob: 0df8bc84ff30f07797aabcb9c3578f61db1ea723 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- blink-2.0.0/blink/resources.py	2016-03-09 14:39:07.000000000 +0100
+++ blink-2.0.0/blink/resources-patched.py	2016-03-12 21:34:14.965476623 +0100
@@ -1,7 +1,10 @@
+# Copyright (C) 2010-2013 AG Projects. See LICENSE for details.
+#
 
 """Provide access to Blink's resources"""
 
-import __main__
+__all__ = ['ApplicationData', 'Resources', 'IconManager']
+
 import imghdr
 import os
 import platform
@@ -19,14 +22,10 @@
 from blink.util import run_in_gui_thread
 
 
-__all__ = ['ApplicationData', 'Resources', 'IconManager']
-
-
 class DirectoryContextManager(unicode):
     def __enter__(self):
         self.directory = os.getcwdu()
         os.chdir(self)
-
     def __exit__(self, type, value, traceback):
         os.chdir(self.directory)
 
@@ -61,18 +60,7 @@
     @classproperty
     def directory(cls):
         if cls._cached_directory is None:
-            try:
-                binary_directory = os.path.dirname(os.path.realpath(__main__.__file__))
-            except AttributeError:
-                if hasattr(sys, 'frozen'):
-                    application_directory = os.path.dirname(os.path.realpath(sys.executable))
-                else:
-                    application_directory = os.path.realpath('')  # executed in interactive interpreter
-            else:
-                if os.path.basename(binary_directory) == 'bin':
-                    application_directory = os.path.dirname(binary_directory)
-                else:
-                    application_directory = binary_directory
+            application_directory = '@out@'
             if os.path.exists(os.path.join(application_directory, 'resources', 'blink.ui')):
                 cls._cached_directory = os.path.join(application_directory, 'resources').decode(sys.getfilesystemencoding())
             else: