diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-08-19 13:56:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-19 13:56:27 -0400 |
| commit | a311774cbcc9d003a0845b283b352f944befe08e (patch) | |
| tree | 5ed4fdd92ef00b5f4cfec71b9d843d9821738207 /lib/api/preferences.py | |
| parent | bb38378f86c1a03ae74c5cba87e2c6aecbe43900 (diff) | |
| parent | 09812b1e9e064778868a5019bbdd9580562b86f6 (diff) | |
Merge pull request #2479 from inkstitch/lexelby/unelectron-preferences
convert Preferences to wxPython
Diffstat (limited to 'lib/api/preferences.py')
| -rw-r--r-- | lib/api/preferences.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/api/preferences.py b/lib/api/preferences.py deleted file mode 100644 index bc8328b8..00000000 --- a/lib/api/preferences.py +++ /dev/null @@ -1,41 +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, request - -from ..utils.cache import get_stitch_plan_cache -from ..utils.settings import global_settings - -preferences = Blueprint('preferences', __name__) - - -@preferences.route('/', methods=["POST"]) -def update_preferences(): - metadata = g.extension.get_inkstitch_metadata() - metadata.update(request.json['this_svg_settings']) - global_settings.update(request.json['global_settings']) - - # cache size may have changed - stitch_plan_cache = get_stitch_plan_cache() - stitch_plan_cache.size_limit = global_settings['cache_size'] * 1024 * 1024 - stitch_plan_cache.cull() - - return jsonify({"status": "success"}) - - -@preferences.route('/', methods=["GET"]) -def get_preferences(): - metadata = g.extension.get_inkstitch_metadata() - return jsonify({"status": "success", - "this_svg_settings": metadata, - "global_settings": global_settings - }) - - -@preferences.route('/clear_cache', methods=["POST"]) -def clear_cache(): - stitch_plan_cache = get_stitch_plan_cache() - stitch_plan_cache.clear(retry=True) - return jsonify({"status": "success"}) |
