Kiln » TortoiseHg » TortoiseHg
Clone URL:  
config.py
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
""" config.py Copyright (C) 2009 Steve Borho <steve@borho.org> This software may be used and distributed according to the terms of the GNU General Public License, incorporated herein by reference. """ # This version of config.py is used in the binary installer # distributions of TortoiseHg on Windows. Since we no longer need to # worry about Python shell extensions, we can use the path of the # current executable to find our package data. import os import sys import win32api, win32process proc = win32api.GetCurrentProcess() try: # This will fail on windows < NT procpath = win32process.GetModuleFileNameEx(proc, 0) except: procpath = win32api.GetModuleFileName(0) bin_path = os.path.dirname(procpath) license_path = os.path.join(bin_path, 'COPYING.txt') locale_path = os.path.join(bin_path, 'locale') icon_path = os.path.join(bin_path, 'icons') enc = sys.getfilesystemencoding() if enc: bin_path = bin_path.encode(enc) license_path = license_path.encode(enc) locale_path = locale_path.encode(enc) icon_path = icon_path.encode(enc)