summaryrefslogtreecommitdiff
path: root/lib/extensions/print_pdf.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extensions/print_pdf.py')
-rw-r--r--lib/extensions/print_pdf.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/extensions/print_pdf.py b/lib/extensions/print_pdf.py
index e5cb25d8..63c3c699 100644
--- a/lib/extensions/print_pdf.py
+++ b/lib/extensions/print_pdf.py
@@ -73,7 +73,10 @@ class PrintPreviewServer(Thread):
def __set_resources_path(self):
if getattr(sys, 'frozen', False):
- self.resources_path = os.path.join(sys._MEIPASS, 'print', 'resources')
+ if sys.platform == "darwin":
+ self.resources_path = os.path.join(sys._MEIPASS, "..", 'Resources', 'print', 'resources')
+ else:
+ self.resources_path = os.path.join(sys._MEIPASS, 'print', 'resources')
else:
self.resources_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', 'print', 'resources'))
@@ -183,7 +186,10 @@ class PrintPreviewServer(Thread):
class Print(InkstitchExtension):
def build_environment(self):
if getattr(sys, 'frozen', False):
- print_dir = os.path.join(sys._MEIPASS, "print")
+ if sys.platform == "darwin":
+ print_dir = os.path.join(sys._MEIPASS, "..", 'Resources', "print")
+ else:
+ print_dir = os.path.join(sys._MEIPASS, "print")
else:
print_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "print"))
@@ -281,7 +287,7 @@ class Print(InkstitchExtension):
'num_trims': stitch_plan.num_trims,
'dimensions': stitch_plan.dimensions_mm,
'num_stitches': stitch_plan.num_stitches,
- 'estimated_thread': '', # TODO
+ 'estimated_thread': stitch_plan.estimated_thread
},
svg_overview=overview_svg,
color_blocks=stitch_plan.color_blocks,
@@ -295,7 +301,7 @@ class Print(InkstitchExtension):
# objects. It's almost certain they meant to print the whole design.
# If they really wanted to print just a few objects, they could set
# the rest invisible temporarily.
- self.svg.selected.clear()
+ self.svg.selection.clear()
if not self.get_elements():
return