equal
deleted
inserted
replaced
21 # You should have received a copy of the GNU General Public License |
21 # You should have received a copy of the GNU General Public License |
22 # along with this program; if not, write to the Free Software |
22 # along with this program; if not, write to the Free Software |
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 from __future__ import absolute_import |
26 |
27 import os |
27 import os |
28 import wx |
28 import wx |
29 import subprocess |
29 import subprocess |
30 from dialogs import MessageBoxOnce |
30 from dialogs import MessageBoxOnce |
31 |
31 |
73 |
73 |
74 def _get_inkscape_version(): |
74 def _get_inkscape_version(): |
75 inkpath = get_inkscape_path() |
75 inkpath = get_inkscape_path() |
76 if inkpath is None: |
76 if inkpath is None: |
77 return None |
77 return None |
78 return map(int, |
78 return list(map(int, |
79 subprocess.check_output([inkpath,"--version"]).split()[1].split('.')) |
79 subprocess.check_output([inkpath,"--version"]).split()[1].split('.'))) |
80 |
80 |
81 _inkscape_version = None |
81 _inkscape_version = None |
82 def get_inkscape_version(): |
82 def get_inkscape_version(): |
83 global _inkscape_version |
83 global _inkscape_version |
84 |
84 |
86 return _inkscape_version |
86 return _inkscape_version |
87 |
87 |
88 _inkscape_version = _get_inkscape_version() |
88 _inkscape_version = _get_inkscape_version() |
89 return _inkscape_version |
89 return _inkscape_version |
90 |
90 |
91 if os.environ.has_key("SNAP"): |
91 if "SNAP" in os.environ: |
92 def open_svg(svgfile): |
92 def open_svg(svgfile): |
93 MessageBoxOnce("Launching Inkscape with xdg-open", |
93 MessageBoxOnce("Launching Inkscape with xdg-open", |
94 "Confined app can't launch Inkscape directly.\n"+ |
94 "Confined app can't launch Inkscape directly.\n"+ |
95 "Instead, SVG file is passed to xdg-open.\n"+ |
95 "Instead, SVG file is passed to xdg-open.\n"+ |
96 "Please select Inskape when proposed.\n\n"+ |
96 "Please select Inskape when proposed.\n\n"+ |