docutil/docsvg.py
changeset 1739 ec153828ded2
parent 1736 7e61baa047f0
child 1740 b789b695b5c6
equal deleted inserted replaced
1738:d2e979738700 1739:ec153828ded2
    37 
    37 
    38 
    38 
    39 def open_win_svg(svgexepath, svgfile):
    39 def open_win_svg(svgexepath, svgfile):
    40     """ Open Inkscape on Windows platform """
    40     """ Open Inkscape on Windows platform """
    41     popenargs = [svgexepath]
    41     popenargs = [svgexepath]
    42     if svgfile is not None :
    42     if svgfile is not None:
    43         popenargs.append(svgfile)
    43         popenargs.append(svgfile)
    44     subprocess.Popen(popenargs).pid
    44     subprocess.Popen(popenargs).pid
    45 
    45 
    46 
    46 
    47 def open_lin_svg(svgexepath, svgfile):
    47 def open_lin_svg(svgexepath, svgfile):
    48     """ Open Inkscape on Linux platform """
    48     """ Open Inkscape on Linux platform """
    49     if os.path.isfile("/usr/bin/inkscape"):
    49     if os.path.isfile("/usr/bin/inkscape"):
    50         os.system("%s %s &" % (svgexepath , svgfile))
    50         os.system("%s %s &" % (svgexepath, svgfile))
    51 
    51 
    52 
    52 
    53 def open_svg(svgfile):
    53 def open_svg(svgfile):
    54     """ Generic function to open SVG file """
    54     """ Generic function to open SVG file """
    55     if wx.Platform == '__WXMSW__' :
    55     if wx.Platform == '__WXMSW__':
    56         try:
    56         try:
    57             open_win_svg(get_inkscape_path(), svgfile)
    57             open_win_svg(get_inkscape_path(), svgfile)
    58         except:
    58         except:
    59             wx.MessageBox("Inkscape is not found or installed !")
    59             wx.MessageBox("Inkscape is not found or installed !")
    60             return None
    60             return None