Scribus Forums

Scribus => Scripts and Plugins => Topic started by: jirib on February 24, 2025, 03:39:54 PM

Title: Attaching python debugger
Post by: jirib on February 24, 2025, 03:39:54 PM
Hi,

I work on some Scribus/Python automation and apart of using `print' for debugging in shell if `scribus' is run from shell directly, I can't figure out if it is possible to attach a debugger for python scripts.

I tried via `remote_pdb' but there is no source visible: does it mean Scribus pushes the actual script to python via stdin ?

Any tips and tricks?
Title: Re: Attaching python debugger
Post by: a.l.e on February 24, 2025, 08:12:55 PM
I've tried to attach a debugger in the past, but I had no luck.

No idea if it's possible to do so.

I might have notes somewhere about what I've tried, but I don't think that it really would help.

When creating complex scripts, my approach is to "mock away" Scribus, with a local module that defines the same commands but does (mostly) nothing.

My mock is here: https://github.com/aoloe/scribus-script-repository/tree/master/mockAPI

With that you can do faster iteration, attach to a debugger, and so on..., by running the script outside of Scribus.