Closed mara004 closed 3 years ago
For reference, in the actual poppler-cpp the position of the underscore is consistent: https://poppler.freedesktop.org/api/cpp/namespacepoppler.html#adfe4efbd3ec91ddf17ead7cf52cbbdea
I think this is the code block that is responsible for how the Rotation Enum looks like: https://github.com/cbrunet/python-poppler/blob/84aae664ddf7b1e86ac5ce3bc1c5e0240a01308b/src/cpp/global.cpp#L68
py::enum_<rotation_enum>(m, "rotation_enum")
.value("rotate_0", rotation_enum::rotate_0)
.value("rotate_90", rotation_enum::rotate_90)
.value("rotate18_0", rotation_enum::rotate_180)
.value("rotate27_0", rotation_enum::rotate_270)
.export_values();
I plan to submit a PR soon.
As of the time of writing, the Rotation Enum of
python-poppler
looks like thiswhich can be confirmed with
The position of the underscore is inconsistent and a potential cause of errors for users who don't look closely (also since there is no note in the documentation concerning the Enum's actual attributes). I think most people would expect all attributes to start with
rotate_
, rather than awkwardly having the underscore inside the rotation number for 180 and 270 degrees.I think the Enum should be restructured to this