TileSet Python export plugins (fixes #1865) by DrDub · Pull Request #3857 · mapeditor/tiled (original) (raw)

@DrDub

Extended the Python plugin to support custom tileset exporters and readers written in Python.

bjorn

requested changes Jan 12, 2024

@DrDub

@bjorn

@bjorn

@bjorn

It appears Qt Creator's Qbs support does not include looking for compiler flags setting include paths (-I). They need to be actually set using cpp.includePaths.

@bjorn

There are actually no defines coming from python3-embed for me.

@bjorn

The problem was that handleError was not called when PyObject_IsSubclass returned -1, which it commonly did when called with a value that wasn't a class. With the error indicator still set, the next call to PyObject_Dir was failing.

Since the errors aren't usually very useful, we just call PyErr_Clear when PyObject_IsSubclass fails.

I couldn't find a convenient way to check if the value is a class, which could avoid raising these errors in the first place.

@bjorn

The PyErr_Print call already clears the error indicator, according to the docs.

@bjorn

@bjorn

@bjorn

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})