docutil/docsvg.py
changeset 3477 9ec5ecf9f589
parent 3111 5d9ae04ee50f
child 3482 31f6d7221f60
equal deleted inserted replaced
3476:46a7aac382ef 3477:9ec5ecf9f589
    31     """ Return the Inkscape binary path """
    31     """ Return the Inkscape binary path """
    32 
    32 
    33     if wx.Platform == '__WXMSW__':
    33     if wx.Platform == '__WXMSW__':
    34         from six.moves import winreg
    34         from six.moves import winreg
    35         inkcmd = None
    35         inkcmd = None
    36         try:
    36         tries = [(winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\svgfile\\shell\\Inkscape\\command'),
    37             inkcmd = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE,
    37                  (winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\inkscape.svg\\shell\\open\\command'),
    38                                            'Software\\Classes\\svgfile\\shell\\Inkscape\\command')
    38                  (winreg.HKEY_CURRENT_USER, 'Software\\Classes\\inkscape.svg\\shell\\open\\command')]
    39         except OSError:
    39 
       
    40         for subreg, key in tries:
    40             try:
    41             try:
    41                 inkcmd = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE,
    42                 inkcmd = winreg.QueryValue(subreg, key)
    42                                                'Software\\Classes\\inkscape.svg\\shell\\open\\command')
    43                 break;
    43             except OSError:
    44             except OSError:
    44                 return None
    45                 pass
       
    46 
       
    47         if inkcmd is None:
       
    48             return None
    45 
    49 
    46         return inkcmd.replace('"%1"', '').strip().replace('"', '')
    50         return inkcmd.replace('"%1"', '').strip().replace('"', '')
    47 
    51 
    48     else:
    52     else:
    49         try:
    53         try: