Lex Neva 2018-01-07 20:41:56 +00:00 zatwierdzone przez GitHub
commit bd7e4952f7
10 zmienionych plików z 26 dodań i 60 usunięć

4
.gitignore vendored
Wyświetl plik

@ -1,2 +1,4 @@
.*.swp
*.pyc
*.pyc
*.zip
inkstitch-venv

9
Makefile 100644
Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
execfile('inkstitch_activate_venv.py')
import os
import sys
import json

Wyświetl plik

@ -1,3 +1,5 @@
execfile('inkstitch_activate_venv.py')
import sys
import os
import numpy

Wyświetl plik

@ -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

Wyświetl plik

@ -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))

Wyświetl plik

@ -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 $@ $^

Wyświetl plik

@ -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>

Wyświetl plik

@ -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()