Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

settings: do not rely on APPDATA environment variable

Fixes #267

Changeset 992d0037d8c1

Parent 7c5a20bfc443

by Steve Borho

Changes to one file · Browse files at 992d0037d8c1 Showing diff from parent 7c5a20bfc443 Diff from another changeset...

 
101
102
103
104
105
 
 
 
 
 
 
 
106
107
108
 
 
109
110
111
 
101
102
103
 
 
104
105
106
107
108
109
110
111
 
 
112
113
114
115
116
@@ -101,11 +101,16 @@
    def _get_path(self, appname):   if os.name == 'nt': - return os.path.join(os.environ.get('APPDATA'), 'TortoiseHg', - appname) + try: + import pywintypes + from win32com.shell import shell, shellcon + appdir = shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_APPDATA) + except (ImportError, pywintypes.com_error): + appdir = os.environ['APPDATA'] + return os.path.join(appdir, 'TortoiseHg', appname)   else: - return os.path.join(os.path.expanduser('~'), '.tortoisehg', - appname) + home = os.path.expanduser('~') + return os.path.join(home, '.tortoisehg', appname)     def _audit(self):   if os.path.exists(os.path.dirname(self._path)):