From 038875f876d79d0f1e971886fe42f5bee4f9f31e Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 21 Aug 2018 20:32:50 -0400 Subject: autopep8 --- lib/extensions/install.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/extensions/install.py') diff --git a/lib/extensions/install.py b/lib/extensions/install.py index 42a92113..2863bef0 100644 --- a/lib/extensions/install.py +++ b/lib/extensions/install.py @@ -28,22 +28,21 @@ class InstallerFrame(wx.Frame): text_sizer = wx.BoxSizer(wx.HORIZONTAL) text = _('Ink/Stitch can install files ("add-ons") that make it easier to use Inkscape to create machine embroidery designs. These add-ons will be installed:') + \ - "\n\n • " + _("thread manufacturer color palettes") + \ - "\n • " + _("Ink/Stitch visual commands (Object -> Symbols...)") + "\n\n • " + _("thread manufacturer color palettes") + "\n • " + _("Ink/Stitch visual commands (Object -> Symbols...)") static_text = wx.StaticText(panel, label=text) font = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL) static_text.SetFont(font) - text_sizer.Add(static_text, proportion=0, flag=wx.ALL|wx.EXPAND, border=10) - sizer.Add(text_sizer, proportion=3, flag=wx.ALL|wx.EXPAND, border=0) + text_sizer.Add(static_text, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) + sizer.Add(text_sizer, proportion=3, flag=wx.ALL | wx.EXPAND, border=0) buttons_sizer = wx.BoxSizer(wx.HORIZONTAL) install_button = wx.Button(panel, wx.ID_ANY, _("Install")) install_button.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK)) - buttons_sizer.Add(install_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) + buttons_sizer.Add(install_button, proportion=0, flag=wx.ALIGN_RIGHT | wx.ALL, border=5) cancel_button = wx.Button(panel, wx.ID_CANCEL, _("Cancel")) - buttons_sizer.Add(cancel_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) - sizer.Add(buttons_sizer, proportion=1, flag=wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM) + buttons_sizer.Add(cancel_button, proportion=0, flag=wx.ALIGN_RIGHT | wx.ALL, border=5) + sizer.Add(buttons_sizer, proportion=1, flag=wx.ALIGN_RIGHT | wx.ALIGN_BOTTOM) panel.SetSizer(sizer) panel.Layout() @@ -63,7 +62,7 @@ class InstallerFrame(wx.Frame): try: self.install_addons('palettes') self.install_addons('symbols') - except Exception, e: + except Exception as e: wx.MessageDialog(self, _('Inkscape add-on installation failed') + ': \n' + traceback.format_exc(), _('Installation Failed'), @@ -97,6 +96,7 @@ class InstallerFrame(wx.Frame): for palette_file in files: shutil.copy(palette_file, dest) + class Install(inkex.Effect): def effect(self): app = wx.App() -- cgit v1.2.3 From 94f391ab4262b5e1c8dace0263467a0ec1f17058 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 21 Aug 2018 20:50:14 -0400 Subject: more pep8 fixes --- lib/extensions/install.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/extensions/install.py') diff --git a/lib/extensions/install.py b/lib/extensions/install.py index 2863bef0..0745eddc 100644 --- a/lib/extensions/install.py +++ b/lib/extensions/install.py @@ -27,8 +27,10 @@ class InstallerFrame(wx.Frame): text_sizer = wx.BoxSizer(wx.HORIZONTAL) - text = _('Ink/Stitch can install files ("add-ons") that make it easier to use Inkscape to create machine embroidery designs. These add-ons will be installed:') + \ - "\n\n • " + _("thread manufacturer color palettes") + "\n • " + _("Ink/Stitch visual commands (Object -> Symbols...)") + text = (_('Ink/Stitch can install files ("add-ons") that make it easier to use Inkscape to create machine embroidery designs. ' + 'These add-ons will be installed:') + + "\n\n • " + _("thread manufacturer color palettes") + + "\n • " + _("Ink/Stitch visual commands (Object -> Symbols...)")) static_text = wx.StaticText(panel, label=text) font = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL) -- cgit v1.2.3 From 908f2cd7727e939b87e3f57c1d3a189705de4c94 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 21 Aug 2018 21:43:09 -0400 Subject: pyflakes fixes --- lib/extensions/install.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/extensions/install.py') diff --git a/lib/extensions/install.py b/lib/extensions/install.py index 0745eddc..314843f4 100644 --- a/lib/extensions/install.py +++ b/lib/extensions/install.py @@ -3,17 +3,12 @@ import sys import traceback import os -from os.path import realpath, dirname from glob import glob -from threading import Thread -import socket -import errno -import time -import logging import wx import inkex from ..utils import guess_inkscape_config_path, get_bundled_dir +from ..i18n import _ class InstallerFrame(wx.Frame): @@ -64,7 +59,7 @@ class InstallerFrame(wx.Frame): try: self.install_addons('palettes') self.install_addons('symbols') - except Exception as e: + except Exception: wx.MessageDialog(self, _('Inkscape add-on installation failed') + ': \n' + traceback.format_exc(), _('Installation Failed'), -- cgit v1.2.3 From 674283c13557a5c0e30d7e8a2048c3297b044888 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 22 Aug 2018 14:12:39 -0400 Subject: fix missing install extension INX file --- lib/extensions/install.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/extensions/install.py') diff --git a/lib/extensions/install.py b/lib/extensions/install.py index 42a92113..3644afad 100644 --- a/lib/extensions/install.py +++ b/lib/extensions/install.py @@ -98,6 +98,10 @@ class InstallerFrame(wx.Frame): shutil.copy(palette_file, dest) class Install(inkex.Effect): + @classmethod + def name(cls): + return "install" + def effect(self): app = wx.App() installer_frame = InstallerFrame(None, title=_("Ink/Stitch Add-ons Installer"), size=(550, 250)) -- cgit v1.2.3 From 82d7f494184a031dabc6f5318c13c477ec8052a1 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 23 Aug 2018 21:24:46 -0400 Subject: properly internationalize install extension --- lib/extensions/install.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/extensions/install.py') diff --git a/lib/extensions/install.py b/lib/extensions/install.py index 3644afad..e405cbac 100644 --- a/lib/extensions/install.py +++ b/lib/extensions/install.py @@ -14,6 +14,7 @@ import wx import inkex from ..utils import guess_inkscape_config_path, get_bundled_dir +from ..i18n import _ class InstallerFrame(wx.Frame): -- cgit v1.2.3