diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2024-04-30 14:21:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 20:21:32 +0200 |
| commit | 3f0f04abec4ef1d12c670bca866db76a5a7d4d6a (patch) | |
| tree | 1a485e0a126d0a3d0619f2b7521081d9edcfe299 /lib/api/stitch_plan.py | |
| parent | 7af665806adc3194ff37393622b088043fec77c7 (diff) | |
simulator fixes (#2844)
* fix slide and control panel rendering bugs
* clear marker lists when clearing stitch plan
* switch simulator back to wx
* remove unused function
* fix off-by-one error in color bar
* avoid overlapping command symbols of different types
* don't maximize simulator
* adjust alignment
* remove unused API server
* bugfix
* focus entire simulator panel
* rename simulator/realistic preview -> simulator
* experimental: background color picker
* set pagecolor to background color by default
* satisfy macos
* toggle jumps on drawing canvas
* clear frog family
---------
Co-authored-by: Kaalleen
Diffstat (limited to 'lib/api/stitch_plan.py')
| -rw-r--r-- | lib/api/stitch_plan.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/api/stitch_plan.py b/lib/api/stitch_plan.py deleted file mode 100644 index 0267a70a..00000000 --- a/lib/api/stitch_plan.py +++ /dev/null @@ -1,29 +0,0 @@ -# Authors: see git history -# -# Copyright (c) 2010 Authors -# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. - -from flask import Blueprint, g, jsonify - -from ..exceptions import InkstitchException, format_uncaught_exception -from ..stitch_plan import stitch_groups_to_stitch_plan - -stitch_plan = Blueprint('stitch_plan', __name__) - - -@stitch_plan.route('') -def get_stitch_plan(): - if not g.extension.get_elements(): - return dict(colors=[], stitch_blocks=[], commands=[]) - - try: - metadata = g.extension.get_inkstitch_metadata() - collapse_len = metadata['collapse_len_mm'] - min_stitch_len = metadata['min_stitch_len_mm'] - stitch_groups = g.extension.elements_to_stitch_groups(g.extension.elements) - stitch_plan = stitch_groups_to_stitch_plan(stitch_groups, collapse_len=collapse_len, min_stitch_len=min_stitch_len) - return jsonify(stitch_plan) - except InkstitchException as exc: - return jsonify({"error_message": str(exc)}), 500 - except Exception: - return jsonify({"error_message": format_uncaught_exception()}), 500 |
