Changeset 992d0037d8c1…
Parent 7c5a20bfc443…
by
Changes to one file · Browse files at 992d0037d8c1 Showing diff from parent 7c5a20bfc443 Diff from another changeset...
@@ -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)):
|
Loading...