kopia lustrzana https://github.com/inkstitch/inkstitch
pyflakes fixes
rodzic
94f391ab42
commit
908f2cd772
|
|
@ -1,6 +1,5 @@
|
|||
import sys
|
||||
from copy import deepcopy
|
||||
from shapely import geometry as shgeo
|
||||
|
||||
from ..i18n import _
|
||||
from ..utils import cache
|
||||
|
|
@ -8,7 +7,6 @@ from ..svg import PIXELS_PER_MM, convert_length, get_doc_size, apply_transforms
|
|||
from ..commands import find_commands
|
||||
|
||||
# inkscape-provided utilities
|
||||
import simpletransform
|
||||
import simplestyle
|
||||
import cubicsuperpath
|
||||
from cspsubdiv import cspsubdiv
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from .element import param, EmbroideryElement, Patch
|
|||
from ..i18n import _
|
||||
from ..svg import PIXELS_PER_MM
|
||||
from ..utils import cache
|
||||
from ..stitches import running_stitch, auto_fill, legacy_fill
|
||||
from ..stitches import legacy_fill
|
||||
|
||||
|
||||
class Fill(EmbroideryElement):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from shapely import geometry as shgeo
|
||||
|
||||
from .element import param, EmbroideryElement, Patch
|
||||
from ..i18n import _
|
||||
from .element import EmbroideryElement, Patch
|
||||
from ..utils.geometry import Point
|
||||
from ..utils import cache
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ from copy import deepcopy
|
|||
from collections import MutableMapping
|
||||
from stringcase import snakecase
|
||||
|
||||
from ..svg.tags import *
|
||||
from ..svg.tags import SVG_GROUP_TAG, INKSCAPE_GROUPMODE, SVG_DEFS_TAG, EMBROIDERABLE_TAGS, SVG_POLYLINE_TAG
|
||||
from ..elements import AutoFill, Fill, Stroke, SatinColumn, Polyline, EmbroideryElement
|
||||
from ..utils import cache
|
||||
from ..commands import is_command, layer_commands
|
||||
from ..i18n import _
|
||||
|
||||
|
||||
SVG_METADATA_TAG = inkex.addNS("metadata", "svg")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import os
|
||||
import sys
|
||||
import inkex
|
||||
from copy import deepcopy
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from ..svg.tags import SVG_PATH_TAG
|
|||
from ..svg import get_correction_transform, PIXELS_PER_MM
|
||||
from ..elements import Stroke
|
||||
from ..utils import Point
|
||||
from ..i18n import _
|
||||
|
||||
|
||||
class SelfIntersectionError(Exception):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
import sys
|
||||
import traceback
|
||||
import os
|
||||
import inkex
|
||||
|
||||
from .base import InkstitchExtension
|
||||
from ..i18n import _
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import sys
|
||||
import inkex
|
||||
import cubicsuperpath
|
||||
from shapely import geometry as shgeo
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
import os
|
||||
from os.path import realpath, dirname, join as path_join
|
||||
import sys
|
||||
from inkex import etree
|
||||
import inkex
|
||||
import pyembroidery
|
||||
|
||||
from ..svg import PIXELS_PER_MM, render_stitch_plan
|
||||
from ..svg.tags import INKSCAPE_LABEL
|
||||
from ..i18n import _
|
||||
from ..stitch_plan import StitchPlan, ColorBlock
|
||||
from ..utils.io import save_stdout
|
||||
from ..stitch_plan import StitchPlan
|
||||
|
||||
|
||||
class Input(object):
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import os
|
||||
import sys
|
||||
import inkex
|
||||
|
||||
from .commands import CommandsExtension
|
||||
from ..commands import LAYER_COMMANDS, get_command_description
|
||||
from ..i18n import _
|
||||
from ..svg.tags import *
|
||||
from ..svg.tags import SVG_USE_TAG, INKSCAPE_LABEL, XLINK_HREF
|
||||
from ..svg import get_correction_transform
|
||||
|
||||
|
||||
|
|
@ -35,7 +33,7 @@ class LayerCommands(CommandsExtension):
|
|||
for i, command in enumerate(commands):
|
||||
self.ensure_symbol(command)
|
||||
|
||||
node = inkex.etree.SubElement(self.current_layer, SVG_USE_TAG,
|
||||
inkex.etree.SubElement(self.current_layer, SVG_USE_TAG,
|
||||
{
|
||||
"id": self.uniqueId("use"),
|
||||
INKSCAPE_LABEL: _("Ink/Stitch Command") + ": %s" % get_command_description(command),
|
||||
|
|
@ -46,5 +44,3 @@ class LayerCommands(CommandsExtension):
|
|||
"y": "-10",
|
||||
"transform": correction_transform
|
||||
})
|
||||
|
||||
namedview = self.document.xpath("//sodipodi:namedview", namespaces=inkex.NSS)
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
import os
|
||||
import sys
|
||||
import inkex
|
||||
import simpletransform
|
||||
import cubicsuperpath
|
||||
from random import random
|
||||
from shapely import geometry as shgeo
|
||||
|
||||
from .commands import CommandsExtension
|
||||
from ..commands import OBJECT_COMMANDS, get_command_description
|
||||
from ..i18n import _
|
||||
from ..elements import SatinColumn
|
||||
from ..svg.tags import *
|
||||
from ..svg.tags import SVG_PATH_TAG, CONNECTION_START, CONNECTION_END, CONNECTOR_TYPE, INKSCAPE_LABEL, SVG_GROUP_TAG, SVG_USE_TAG, XLINK_HREF
|
||||
from ..svg import get_correction_transform
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
import sys
|
||||
import traceback
|
||||
import os
|
||||
import inkex
|
||||
import tempfile
|
||||
|
||||
from .base import InkstitchExtension
|
||||
from ..i18n import _
|
||||
from ..output import write_embroidery_file
|
||||
from ..stitch_plan import patches_to_stitch_plan
|
||||
from ..svg import render_stitch_plan, PIXELS_PER_MM
|
||||
from ..utils.io import save_stdout
|
||||
from ..svg import PIXELS_PER_MM
|
||||
|
||||
|
||||
class Output(InkstitchExtension):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import sys
|
||||
import traceback
|
||||
import os
|
||||
from threading import Thread
|
||||
import socket
|
||||
|
|
@ -13,15 +12,14 @@ import json
|
|||
import inkex
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
from datetime import date
|
||||
import base64
|
||||
from flask import Flask, request, Response, send_from_directory, jsonify
|
||||
import webbrowser
|
||||
import requests
|
||||
|
||||
from .base import InkstitchExtension
|
||||
from ..i18n import _, translation as inkstitch_translation
|
||||
from ..svg import PIXELS_PER_MM, render_stitch_plan
|
||||
from ..svg.tags import SVG_GROUP_TAG, INKSCAPE_GROUPMODE
|
||||
from ..svg import render_stitch_plan
|
||||
from ..svg.tags import INKSCAPE_GROUPMODE
|
||||
from ..stitch_plan import patches_to_stitch_plan
|
||||
from ..threads import ThreadCatalog
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import sys
|
||||
import traceback
|
||||
import os
|
||||
import inkex
|
||||
import tempfile
|
||||
from zipfile import ZipFile
|
||||
import pyembroidery
|
||||
|
|
@ -10,8 +8,7 @@ from .base import InkstitchExtension
|
|||
from ..i18n import _
|
||||
from ..output import write_embroidery_file
|
||||
from ..stitch_plan import patches_to_stitch_plan
|
||||
from ..svg import render_stitch_plan, PIXELS_PER_MM
|
||||
from ..utils.io import save_stdout
|
||||
from ..svg import PIXELS_PER_MM
|
||||
|
||||
|
||||
class Zip(InkstitchExtension):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import os
|
||||
|
||||
from .inputs import generate_input_inx_files
|
||||
from .outputs import generate_output_inx_files
|
||||
from .extensions import generate_extension_inx_files
|
||||
from .utils import iterate_inx_locales, inx_path
|
||||
from .utils import iterate_inx_locales
|
||||
|
||||
|
||||
def generate_inx_files():
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import gettext
|
|||
from os.path import dirname
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
from ..i18n import translation as default_translation, locale_dir, _, N_
|
||||
from ..i18n import translation as default_translation, locale_dir, N_
|
||||
|
||||
|
||||
_top_path = dirname(dirname(dirname(os.path.realpath(__file__))))
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
import sys
|
||||
import shapely
|
||||
import networkx
|
||||
import math
|
||||
from itertools import groupby, izip
|
||||
from collections import deque
|
||||
|
||||
from .fill import intersect_region_with_grating, row_num, stitch_row
|
||||
from .running_stitch import running_stitch
|
||||
from ..i18n import _
|
||||
from ..svg import PIXELS_PER_MM
|
||||
from ..utils.geometry import Point as InkstitchPoint, cut
|
||||
|
||||
|
||||
|
|
@ -367,7 +365,6 @@ def find_stitch_path(graph, segments, starting_point=None, ending_point=None):
|
|||
the order of most-recently-visited first.
|
||||
"""
|
||||
|
||||
original_graph = graph
|
||||
graph = graph.copy()
|
||||
num_segments = len(segments)
|
||||
segments_visited = 0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import shapely
|
||||
import math
|
||||
import sys
|
||||
|
||||
from ..svg import PIXELS_PER_MM
|
||||
from ..utils import cache, Point as InkstitchPoint
|
||||
|
|
@ -167,9 +166,7 @@ def intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing=Non
|
|||
|
||||
def section_to_stitches(group_of_segments, angle, row_spacing, max_stitch_length, staggers):
|
||||
stitches = []
|
||||
first_segment = True
|
||||
swap = False
|
||||
last_end = None
|
||||
|
||||
for segment in group_of_segments:
|
||||
(beg, end) = segment
|
||||
|
|
@ -240,7 +237,7 @@ def pull_runs(rows, shape, row_spacing):
|
|||
|
||||
# print >> sys.stderr, len(run)
|
||||
runs.append(run)
|
||||
rows = [row for row in rows if len(row) > 0]
|
||||
rows = [r for r in rows if len(r) > 0]
|
||||
|
||||
count += 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import simpletransform
|
||||
import cubicsuperpath
|
||||
|
||||
from .units import get_viewbox_transform
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import simplepath
|
|||
import math
|
||||
|
||||
from .units import PIXELS_PER_MM
|
||||
from ..utils import cache, Point
|
||||
from ..utils import Point
|
||||
|
||||
# The stitch vector path looks like this:
|
||||
# _______
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import simpletransform
|
||||
|
||||
from ..utils import cache
|
||||
from ..i18n import _
|
||||
|
||||
# modern versions of Inkscape use 96 pixels per inch as per the CSS standard
|
||||
PIXELS_PER_MM = 96 / 25.4
|
||||
|
|
|
|||
|
|
@ -41,8 +41,11 @@ class ThreadPalette(Set):
|
|||
if self.name.lower().startswith('name: ink/stitch: '):
|
||||
self.name = self.name[18:]
|
||||
|
||||
columns_line = palette.readline()
|
||||
headers_line = palette.readline()
|
||||
# number of columns
|
||||
palette.readline()
|
||||
|
||||
# headers
|
||||
palette.readline()
|
||||
|
||||
for line in palette:
|
||||
fields = line.split("\t", 3)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class Point:
|
|||
if isinstance(other, (int, float)):
|
||||
return self * (1.0 / other)
|
||||
else:
|
||||
raise ValueErorr("cannot divide Point by %s" % type(other))
|
||||
raise ValueError("cannot divide Point by %s" % type(other))
|
||||
|
||||
def __repr__(self):
|
||||
return "Point(%s,%s)" % (self.x, self.y)
|
||||
|
|
|
|||
66
messages.po
66
messages.po
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2018-08-21 20:50-0400\n"
|
||||
"POT-Creation-Date: 2018-08-21 21:43-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -119,7 +119,7 @@ msgid ""
|
|||
"shapes."
|
||||
msgstr ""
|
||||
|
||||
#: lib/elements/element.py:232
|
||||
#: lib/elements/element.py:230
|
||||
#, python-format
|
||||
msgid "%(id)s has more than one command of type '%(command)s' linked to it"
|
||||
msgstr ""
|
||||
|
|
@ -381,106 +381,106 @@ msgstr ""
|
|||
msgid "Tip: use Path -> Object to Path to convert non-paths."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/convert_to_satin.py:28
|
||||
#: lib/extensions/convert_to_satin.py:29
|
||||
msgid "Please select at least one line to convert to a satin column."
|
||||
msgstr ""
|
||||
|
||||
#. : Convert To Satin extension, user selected one or more objects that were
|
||||
#. not lines.
|
||||
#: lib/extensions/convert_to_satin.py:33
|
||||
#: lib/extensions/convert_to_satin.py:34
|
||||
msgid "Only simple lines may be converted to satin columns."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/convert_to_satin.py:55
|
||||
#: lib/extensions/convert_to_satin.py:56
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Cannot convert %s to a satin column because it intersects itself. Try "
|
||||
"breaking it up into multiple paths."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/embroider.py:41
|
||||
#: lib/extensions/embroider.py:38
|
||||
msgid ""
|
||||
"\n"
|
||||
"\n"
|
||||
"Seeing a 'no such option' message? Please restart Inkscape to fix."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/flip.py:36
|
||||
#: lib/extensions/flip.py:35
|
||||
msgid "Please select one or more satin columns to flip."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:30
|
||||
#: lib/extensions/install.py:25
|
||||
msgid ""
|
||||
"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:"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:32
|
||||
#: lib/extensions/install.py:27
|
||||
msgid "thread manufacturer color palettes"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:33
|
||||
#: lib/extensions/install.py:28
|
||||
msgid "Ink/Stitch visual commands (Object -> Symbols...)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:42
|
||||
#: lib/extensions/install.py:37
|
||||
msgid "Install"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:45 lib/extensions/params.py:380
|
||||
#: lib/extensions/install.py:40 lib/extensions/params.py:380
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:59
|
||||
#: lib/extensions/install.py:54
|
||||
msgid "Choose Inkscape directory"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:69
|
||||
#: lib/extensions/install.py:64
|
||||
msgid "Inkscape add-on installation failed"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:70
|
||||
#: lib/extensions/install.py:65
|
||||
msgid "Installation Failed"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:74
|
||||
#: lib/extensions/install.py:69
|
||||
msgid ""
|
||||
"Inkscape add-on files have been installed. Please restart Inkscape to "
|
||||
"load the new add-ons."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:75
|
||||
#: lib/extensions/install.py:70
|
||||
msgid "Installation Completed"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/install.py:105
|
||||
#: lib/extensions/install.py:100
|
||||
msgid "Ink/Stitch Add-ons Installer"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/layer_commands.py:29
|
||||
#: lib/extensions/layer_commands.py:27
|
||||
msgid "Please choose one or more commands to add."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/layer_commands.py:41 lib/extensions/object_commands.py:80
|
||||
#: lib/extensions/layer_commands.py:39 lib/extensions/object_commands.py:74
|
||||
msgid "Ink/Stitch Command"
|
||||
msgstr ""
|
||||
|
||||
#. : the name of the line that connects a command to the object it applies to
|
||||
#: lib/extensions/object_commands.py:36
|
||||
#: lib/extensions/object_commands.py:30
|
||||
msgid "connector"
|
||||
msgstr ""
|
||||
|
||||
#. : the name of a command symbol (example: scissors icon for trim command)
|
||||
#: lib/extensions/object_commands.py:95
|
||||
#: lib/extensions/object_commands.py:89
|
||||
msgid "command marker"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/object_commands.py:106
|
||||
#: lib/extensions/object_commands.py:100
|
||||
msgid "Please select one or more objects to which to attach commands."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/object_commands.py:114
|
||||
#: lib/extensions/object_commands.py:108
|
||||
msgid "Please choose one or more commands to attach."
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -578,15 +578,15 @@ msgid ""
|
|||
"\"Overwrite\""
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/print_pdf.py:134
|
||||
#: lib/extensions/print_pdf.py:132
|
||||
msgid "Closing..."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/print_pdf.py:134
|
||||
#: lib/extensions/print_pdf.py:132
|
||||
msgid "It is safe to close this window now."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/print_pdf.py:265
|
||||
#: lib/extensions/print_pdf.py:263
|
||||
msgid ""
|
||||
"A print preview has been opened in your web browser. This window will "
|
||||
"stay open in order to communicate with the JavaScript code running in "
|
||||
|
|
@ -596,7 +596,7 @@ msgid ""
|
|||
" or you can close it manually if necessary."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/print_pdf.py:414
|
||||
#: lib/extensions/print_pdf.py:412
|
||||
msgid "Ink/Stitch Print"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -604,7 +604,7 @@ msgstr ""
|
|||
msgid "Embroidery Simulation"
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/zip.py:52
|
||||
#: lib/extensions/zip.py:49
|
||||
msgid "No embroidery file formats selected."
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -663,13 +663,13 @@ msgstr ""
|
|||
msgid "Stitch #"
|
||||
msgstr ""
|
||||
|
||||
#: lib/stitches/auto_fill.py:169
|
||||
#: lib/stitches/auto_fill.py:167
|
||||
msgid ""
|
||||
"Unable to autofill. This most often happens because your shape is made "
|
||||
"up of multiple sections that aren't connected."
|
||||
msgstr ""
|
||||
|
||||
#: lib/stitches/auto_fill.py:398
|
||||
#: lib/stitches/auto_fill.py:395
|
||||
msgid ""
|
||||
"Unexpected error while generating fill stitches. Please send your SVG "
|
||||
"file to lexelby@github."
|
||||
|
|
@ -679,12 +679,12 @@ msgstr ""
|
|||
msgid "Stitch Plan"
|
||||
msgstr ""
|
||||
|
||||
#: lib/svg/units.py:45
|
||||
#: lib/svg/units.py:46
|
||||
#, python-format
|
||||
msgid "parseLengthWithUnits: unknown unit %s"
|
||||
msgstr ""
|
||||
|
||||
#: lib/svg/units.py:77
|
||||
#: lib/svg/units.py:78
|
||||
#, python-format
|
||||
msgid "Unknown unit: %s"
|
||||
msgstr ""
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue