pull/2720/head
karnigen 2024-03-24 14:30:59 +01:00
rodzic 1063ea147e
commit 2ec1d5a080
6 zmienionych plików z 14 dodań i 10 usunięć

Wyświetl plik

@ -1,3 +1,5 @@
### customize this file and save as DEBUG.toml
[LIBRARY]
### use the pip installed version of inkex.py, default: true
# prefer_pip_inkex = false

Wyświetl plik

@ -1,7 +1,8 @@
### customize this file and save as LOGGING.toml
### logging/warning template for inkstitch
### format: toml
### enable config file in DEBUG.toml: log_config_file
###
### warnings.simplefilter(action), default: "default"
### - possible values: "error", "ignore", "always", "default", "module", "once"
warnings_action = "default"
@ -13,7 +14,7 @@ warnings_capture = true
### mandatory, must be an integer and 1
version = 1
### disable loggers not specified here true/false - may be overrided by root logger
### disable loggers activated before the configuration is loaded
disable_existing_loggers = false
### define the loggers, handlers, formatters, filters

Wyświetl plik

@ -28,7 +28,7 @@ logger = logging.getLogger("inkstitch") # create module logger with name 'inks
# TODO --- temporary --- catch old DEBUG.ini file and inform user to reformat it to DEBUG.toml
old_debug_ini = SCRIPTDIR / "DEBUG.ini"
if old_debug_ini.exists():
print("ERROR: old DEBUG.ini exists, please reformat it to DEBUG.toml and remove DEBUG.ini file")
print("ERROR: old DEBUG.ini exists, please reformat it to DEBUG.toml and remove DEBUG.ini file", file=sys.stderr)
exit(1)
# --- end of temporary ---
@ -57,9 +57,9 @@ if len(sys.argv) < 2:
dlg.ShowModal()
dlg.Destroy()
except ImportError:
print(msg)
print(msg, file=sys.stderr)
else:
print(msg)
print(msg, file=sys.stderr)
exit(1)
# activate logging - must be done before any logging is done
@ -109,8 +109,9 @@ if debug_type != 'none':
debug_active = bool((gettrace := getattr(sys, 'gettrace')) and gettrace())
# activate logging for svg
# we need to import only after possible modification of sys.path, we disable here flake8 E402
from lib.debug import debug # noqa: E402 # import global variable debug - don't import whole module
debug.enable() # see source how enable/disable logging
debug.enable() # perhaps it would be better to find a more relevant name; in fact, it's about logging and svg creation.
# log startup info
debug_logging.startup_info(logger, SCRIPTDIR, running_as_frozen, running_from_inkscape, debug_active, debug_type, profiler_type)

Wyświetl plik

@ -1,6 +1,6 @@
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Copyright (c) 2024 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
@ -170,7 +170,7 @@ def init_debugger(debug_type:str, ini: dict):
if debugger == 'vscode':
debugpy.listen(('localhost', 5678))
if wait_attach:
print("Waiting for debugger attach")
print("Waiting for debugger attach", file=sys.stderr)
debugpy.wait_for_client() # wait for debugger to attach
debugpy.breakpoint() # stop here to start normal debugging
elif debugger == 'pycharm':

Wyświetl plik

@ -1,6 +1,6 @@
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Copyright (c) 2024 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
# basic info for inkstitch logging:

Wyświetl plik

@ -1,6 +1,6 @@
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Copyright (c) 2024 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
# this file is without: import inkex