Changeset 2502

Show
Ignore:
Timestamp:
11/14/08 16:21:31 (8 weeks ago)
Author:
bzr
Message:

* Hopefully fixed unicode handling of config directory path.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property bzr:revision-info
      •  

        old new  
        1 timestamp: 2008-11-14 16:21:26.015000105 +0100 
         1timestamp: 2008-11-14 17:21:00.687000036 +0100 
        22committer: Peter Vágner <peter.v@datagate.sk> 
        33properties:  
    • Property bzr:revision-id:v3-list-QlpoOTFBWSZTWbrL2vUAAB1VgAAQABCAQDrrnqAgAFCgaaGRkxBoTIJ6mmaNRwhndFAoNhZjh_YY4a01fOg1ulgNNC2UrzPdXXEnDpX8XckU4UJC6y9r1A..
      •  

        old new  
        2712712299 mick@kulgan.net-20081113224846-xq2tw48ag6wyw1om 
        2722722300 peter.v@datagate.sk-20081114152126-wxhfcy39etubrcya 
         2732301 peter.v@datagate.sk-20081114162100-uy1tdrrga4msh6gd 
    • Property bzr:file-ids
      •  

        old new  
        1 source/locale/fi/LC_MESSAGES/nvda.po    600@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Flocale%2Ffi%2FLC_MESSAGES%2Fnvda.po 
         1source/config/__init__.py       46@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Fconfig%2F__init__.py 
  • trunk/source/config/__init__.py

    r2496 r2502  
    99from validate import Validator 
    1010from logHandler import log 
     11import ctypes 
     12 
     13CSIDL_APPDATA=26 
     14MAX_PATH=256 
    1115 
    1216val = Validator() 
     
    199203                        instDir="" 
    200204                _winreg.CloseKey(k) 
    201                 return os.path.normpath(os.getcwd())==os.path.normpath(instDir) 
     205                return os.path.normpath(os.getcwdu()).lower()==os.path.normpath(instDir).lower() 
    202206        except: 
    203207                return False 
    204208 
    205209def getUserDefaultConfigPath(): 
    206         if isInstalledCopy(): 
    207                 return os.path.expandvars(u'$appdata\\nvda') 
     210        buf=ctypes.create_unicode_buffer(MAX_PATH) 
     211        if isInstalledCopy() and ctypes.windll.shell32.SHGetSpecialFolderPathW(0,buf,CSIDL_APPDATA,0): 
     212                return u'%s\\nvda'%buf.value 
    208213        else: 
    209214                return u'.\\'