kopia lustrzana https://github.com/inkstitch/inkstitch
Merge 5291167e89
into f244f58a17
commit
bd7e4952f7
|
@ -1,2 +1,4 @@
|
|||
.*.swp
|
||||
*.pyc
|
||||
*.pyc
|
||||
*.zip
|
||||
inkstitch-venv
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
dist: *.py *.inx inkstitch-venv
|
||||
zip -r inkstitch-$$(git tag -l | grep ^v | tail -n 1)-$$(uname)-$$(uname -m).zip *.py *.inx inkstitch-venv
|
||||
|
||||
inkstitch-venv: requirements.txt
|
||||
rm -rf inkstitch-venv
|
||||
virtualenv inkstitch-venv
|
||||
source inkstitch-venv/bin/activate \
|
||||
pip install -r requirements.txt \
|
||||
for file in inkstitch-venv/lib/python*/site-packages/wx/_*.so; do patchelf --set-rpath '$$ORIGIN'; done
|
|
@ -10,10 +10,11 @@
|
|||
# Embroidery file format documentation:
|
||||
# http://www.achatina.de/sewing/main/TECHNICL.HTM
|
||||
|
||||
execfile('inkstitch_activate_venv.py')
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
sys.path.append("/usr/share/inkscape/extensions")
|
||||
import os
|
||||
import subprocess
|
||||
from copy import deepcopy
|
||||
import time
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
execfile('inkstitch_activate_venv.py')
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
execfile('inkstitch_activate_venv.py')
|
||||
|
||||
import sys
|
||||
import os
|
||||
import numpy
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# Update embroidery parameters stored in XML attributes from old to new
|
||||
# format.
|
||||
|
||||
execfile('inkstitch_activate_venv.py')
|
||||
|
||||
import sys
|
||||
sys.path.append("/usr/share/inkscape/extensions")
|
||||
import os
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.path.isdir("inkstitch-venv"):
|
||||
activate = os.path.join("inkstitch-venv", "bin", "activate_this.py")
|
||||
execfile(activate, dict(__file__=activate))
|
3
makefile
3
makefile
|
@ -1,3 +0,0 @@
|
|||
embroider.tgz: makefile index.html embroider.py embroider.inx images/draft1.jpg images/draft2.jpg images/shirt.jpg PyEmb.py
|
||||
ln -fs embroider .
|
||||
tar czf $@ $^
|
16
reorder.inx
16
reorder.inx
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>Reorder</_name>
|
||||
<id>lexelby.embroider.reorder</id>
|
||||
<dependency type="executable" location="extensions">reorder.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<effect>
|
||||
<object-type>all</object-type>
|
||||
<effects-menu>
|
||||
<submenu _name="Embroidery"/>
|
||||
</effects-menu>
|
||||
</effect>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">reorder.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
39
reorder.py
39
reorder.py
|
@ -1,39 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Remove selected objects from the document and readd them in the order they
|
||||
# were selected.
|
||||
|
||||
import sys
|
||||
sys.path.append("/usr/share/inkscape/extensions")
|
||||
import os
|
||||
import inkex
|
||||
|
||||
|
||||
class Reorder(inkex.Effect):
|
||||
|
||||
def get_selected_in_order(self):
|
||||
selected = []
|
||||
|
||||
for i in self.options.ids:
|
||||
path = '//*[@id="%s"]' % i
|
||||
for node in self.document.xpath(path, namespaces=inkex.NSS):
|
||||
selected.append(node)
|
||||
|
||||
return selected
|
||||
|
||||
def effect(self):
|
||||
objects = self.get_selected_in_order()
|
||||
|
||||
for obj in objects[1:]:
|
||||
obj.getparent().remove(obj)
|
||||
|
||||
insert_parent = objects[0].getparent()
|
||||
insert_pos = insert_parent.index(objects[0])
|
||||
|
||||
insert_parent.remove(objects[0])
|
||||
|
||||
insert_parent[insert_pos:insert_pos] = objects
|
||||
|
||||
if __name__ == '__main__':
|
||||
e = Reorder()
|
||||
e.affect()
|
Ładowanie…
Reference in New Issue