diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-03-30 20:37:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-30 20:37:11 -0400 |
| commit | 084c5555f21a6e927e4de98fdb66c4c408626f58 (patch) | |
| tree | 91e2da4493f4dcc5243114d3f73296b4a0166543 /embroider_update.py | |
| parent | 1279b3ec47fa9c7eb6540e255b67389644fb0b38 (diff) | |
print through web browser (#127)
* spawn a web server and open a printable view of the design in the user's web browser
* configurable inclusion of client and operator views
* editable fields for color names, client, title, and purchase order number
* groundwork laid to save these parameters back into the SVG
* major refactor of codebase to support printing
* code is organized logically into modules
* added inkstitch logo and branding guidelines
* l10n text extraction now handled by babel
* removed legacy embroider_update extension
* partial fix for #125
Diffstat (limited to 'embroider_update.py')
| -rw-r--r-- | embroider_update.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/embroider_update.py b/embroider_update.py deleted file mode 100644 index b6821d54..00000000 --- a/embroider_update.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python -# -# Update embroidery parameters stored in XML attributes from old to new -# format. - -import sys -sys.path.append("/usr/share/inkscape/extensions") -import os -import inkex -import simplestyle - -PIXELS_PER_MM = 10 - - -class EmbroiderParams(inkex.Effect): - - def __init__(self, *args, **kwargs): - inkex.Effect.__init__(self) - - self.mapping = {"zigzag_spacing": "zigzag_spacing_mm", - "row_spacing": "row_spacing_mm", - "pull_compensation": "pull_compensation_mm", - "max_stitch_length": "max_stitch_length_mm", - "satin_underlay": "contour_underlay", - "satin_underlay_inset": "contour_underlay_inset_mm", - "satin_zigzag_underlay_spacing": "zigzag_underlay_spacing_mm", - "satin_center_walk": "center_walk_underlay", - "stitch_length": "running_stitch_length_mm", - } - - def effect(self): - for node in self.document.getroot().iter(): - for old, new in self.mapping.iteritems(): - old = "embroider_%s" % old - new = "embroider_%s" % new - - value = node.attrib.pop(old, None) - if value: - if new.endswith('_mm') and value.strip(): - value = str(float(value) / PIXELS_PER_MM) - - node.set(new, value) - - if 'embroider_zigzag_underlay_spacing_mm' in node.attrib: - node.set('embroider_zigzag_underlay', 'yes') - - style = simplestyle.parseStyle(node.get('style')) - - if style.get('fill', 'none') != 'none' and \ - 'embroider_auto_fill' not in node.attrib: - node.set('embroider_auto_fill', 'no') - -if __name__ == '__main__': - e = EmbroiderParams() - e.affect() |
