fix dll detection under windows. Fixes #5968
This commit is contained in:
		
							parent
							
								
									f51a7d6b8a
								
							
						
					
					
						commit
						a20d8bd446
					
				
					 1 changed files with 27 additions and 29 deletions
				
			
		
							
								
								
									
										56
									
								
								src/gajim.py
									
										
									
									
									
								
							
							
						
						
									
										56
									
								
								src/gajim.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -35,6 +35,33 @@
 | 
			
		|||
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
import warnings
 | 
			
		||||
 | 
			
		||||
if os.name == 'nt':
 | 
			
		||||
    log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
 | 
			
		||||
    if not os.path.exists(log_path):
 | 
			
		||||
        os.mkdir(log_path, 0700)
 | 
			
		||||
    log_file = os.path.join(log_path, 'gajim.log')
 | 
			
		||||
    fout = open(log_file, 'a')
 | 
			
		||||
    sys.stdout = fout
 | 
			
		||||
    sys.stderr = fout
 | 
			
		||||
 | 
			
		||||
    warnings.filterwarnings(action='ignore')
 | 
			
		||||
 | 
			
		||||
    if os.path.isdir('gtk'):
 | 
			
		||||
        # Used to create windows installer with GTK included
 | 
			
		||||
        paths = os.environ['PATH']
 | 
			
		||||
        list_ = paths.split(';')
 | 
			
		||||
        new_list = []
 | 
			
		||||
        for p in list_:
 | 
			
		||||
            if p.find('gtk') < 0 and p.find('GTK') < 0:
 | 
			
		||||
                new_list.append(p)
 | 
			
		||||
        new_list.insert(0, os.path.join(os.getcwd(), 'gtk', 'lib'))
 | 
			
		||||
        new_list.insert(0, os.path.join(os.getcwd(), 'gtk', 'bin'))
 | 
			
		||||
        os.environ['PATH'] = ';'.join(new_list)
 | 
			
		||||
 | 
			
		||||
from common import demandimport
 | 
			
		||||
demandimport.enable()
 | 
			
		||||
demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n',
 | 
			
		||||
| 
						 | 
				
			
			@ -42,9 +69,6 @@ demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n',
 | 
			
		|||
    'command_system.implementation.standard', 'OpenSSL.SSL', 'OpenSSL.crypto',
 | 
			
		||||
    'common.sleepy', 'DLFCN', 'dl', 'xml.sax', 'xml.sax.handler', 'ic']
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
if os.name == 'nt':
 | 
			
		||||
    import locale
 | 
			
		||||
    import gettext
 | 
			
		||||
| 
						 | 
				
			
			@ -70,32 +94,6 @@ if os.name == 'nt':
 | 
			
		|||
    libintl.bindtextdomain(APP, DIR)
 | 
			
		||||
    libintl.bind_textdomain_codeset(APP, 'UTF-8')
 | 
			
		||||
 | 
			
		||||
import warnings
 | 
			
		||||
 | 
			
		||||
if os.name == 'nt':
 | 
			
		||||
    log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
 | 
			
		||||
    if not os.path.exists(log_path):
 | 
			
		||||
        os.mkdir(log_path, 0700)
 | 
			
		||||
    log_file = os.path.join(log_path, 'gajim.log')
 | 
			
		||||
    fout = open(log_file, 'a')
 | 
			
		||||
    sys.stdout = fout
 | 
			
		||||
    sys.stderr = fout
 | 
			
		||||
 | 
			
		||||
    warnings.filterwarnings(action='ignore')
 | 
			
		||||
 | 
			
		||||
    if os.path.isdir('gtk'):
 | 
			
		||||
        # Used to create windows installer with GTK included
 | 
			
		||||
        paths = os.environ['PATH']
 | 
			
		||||
        list_ = paths.split(';')
 | 
			
		||||
        new_list = []
 | 
			
		||||
        for p in list_:
 | 
			
		||||
            if p.find('gtk') < 0 and p.find('GTK') < 0:
 | 
			
		||||
                new_list.append(p)
 | 
			
		||||
        new_list.insert(0, 'gtk/lib')
 | 
			
		||||
        new_list.insert(0, 'gtk/bin')
 | 
			
		||||
        os.environ['PATH'] = ';'.join(new_list)
 | 
			
		||||
        os.environ['GTK_BASEPATH'] = 'gtk'
 | 
			
		||||
 | 
			
		||||
if os.name == 'nt':
 | 
			
		||||
    # needed for docutils
 | 
			
		||||
    sys.path.append('.')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue