23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 |
24 |
25 |
25 |
26 |
26 |
27 import os |
27 import os |
|
28 import sys |
28 import wx |
29 import wx |
29 import subprocess |
30 import subprocess |
30 from dialogs import MessageBoxOnce |
31 from dialogs import MessageBoxOnce |
31 |
32 |
32 |
33 |
33 def _get_inkscape_path(): |
34 def _get_inkscape_path(): |
34 """ Return the Inkscape binary path """ |
35 """ Return the Inkscape binary path """ |
35 |
36 |
36 if wx.Platform == '__WXMSW__': |
37 if sys.platform.startswith('win32'): |
37 from six.moves import winreg |
38 import winreg |
38 inkcmd = None |
39 inkcmd = None |
39 tries = [(winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\svgfile\\shell\\Inkscape\\command'), |
40 tries = [(winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\svgfile\\shell\\Inkscape\\command'), |
40 (winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\inkscape.svg\\shell\\open\\command'), |
41 (winreg.HKEY_LOCAL_MACHINE, 'Software\\Classes\\inkscape.svg\\shell\\open\\command'), |
41 (winreg.HKEY_CURRENT_USER, 'Software\\Classes\\inkscape.svg\\shell\\open\\command')] |
42 (winreg.HKEY_CURRENT_USER, 'Software\\Classes\\inkscape.svg\\shell\\open\\command')] |
42 |
43 |