kopia lustrzana https://github.com/inkstitch/inkstitch
set up and install gettext
rodzic
75fa168a6f
commit
55cd128dd4
|
@ -37,6 +37,7 @@ from pprint import pformat
|
|||
import inkstitch
|
||||
from inkstitch import cache, dbg, param, EmbroideryElement, get_nodes, SVG_POLYLINE_TAG, SVG_GROUP_TAG, PIXELS_PER_MM, get_viewbox_transform
|
||||
|
||||
inkstitch.localize()
|
||||
|
||||
class Fill(EmbroideryElement):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
@ -13,12 +13,17 @@ import wx
|
|||
from wx.lib.scrolledpanel import ScrolledPanel
|
||||
from collections import defaultdict
|
||||
import inkex
|
||||
import inkstitch
|
||||
from inkstitch import Param, EmbroideryElement, get_nodes
|
||||
from embroider import Fill, AutoFill, Stroke, SatinColumn
|
||||
from functools import partial
|
||||
from itertools import groupby
|
||||
from embroider_simulate import EmbroiderySimulator
|
||||
|
||||
|
||||
inkstitch.localize()
|
||||
|
||||
|
||||
def presets_path():
|
||||
try:
|
||||
import appdirs
|
||||
|
|
|
@ -6,9 +6,14 @@ import inkex
|
|||
import simplestyle
|
||||
import colorsys
|
||||
|
||||
import inkstitch
|
||||
from inkstitch import PIXELS_PER_MM
|
||||
from embroider import patches_to_stitches, get_elements, elements_to_patches
|
||||
|
||||
|
||||
inkstitch.localize()
|
||||
|
||||
|
||||
class EmbroiderySimulator(wx.Frame):
|
||||
def __init__(self, *args, **kwargs):
|
||||
stitch_file = kwargs.pop('stitch_file', None)
|
||||
|
|
14
inkstitch.py
14
inkstitch.py
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
# http://www.achatina.de/sewing/main/TECHNICL.HTM
|
||||
|
||||
import os
|
||||
import sys
|
||||
import gettext
|
||||
from copy import deepcopy
|
||||
import math
|
||||
import libembroidery
|
||||
|
@ -35,6 +37,18 @@ dbg = open("/tmp/embroider-debug.txt", "w")
|
|||
def cache(*args, **kwargs):
|
||||
return lru_cache(maxsize=None)(*args, **kwargs)
|
||||
|
||||
def localize():
|
||||
if getattr(sys, 'frozen', False):
|
||||
# we are in a pyinstaller installation
|
||||
locale_dir = sys._MEIPASS
|
||||
else:
|
||||
locale_dir = os.path.dirname(__file__)
|
||||
|
||||
locale_dir = os.path.join(locale_dir, 'locales')
|
||||
|
||||
translation = gettext.translation("inkstitch", locale_dir, fallback=True)
|
||||
translation.install()
|
||||
|
||||
# cribbed from inkscape-silhouette
|
||||
def parse_length_with_units( str ):
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue