Skip to content
Permalink
Browse files
[sipify] add attribute to know if an enum is monkey patched
this way it can be easily removed from the PyQGIS API docs
  • Loading branch information
3nids committed May 31, 2021
1 parent 3f4b48a commit 759e3db119bd482340515fd023cc54b38bd8b2cd
Showing with 2 additions and 0 deletions.
  1. +2 −0 scripts/sipify.pl
@@ -1086,10 +1086,12 @@ sub detect_non_method_member{
if ( $monkeypatch eq 1 and $enum_mk_base ne ""){
if ( $ACTUAL_CLASS ne "" ) {
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name = $ACTUAL_CLASS.$enum_qualname.$enum_member\n";
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name.is_monkey_patched = True\n";
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name.__doc__ = \"$comment\"\n";
push @enum_members_doc, "'* ``$compat_name``: ' + $ACTUAL_CLASS.$enum_qualname.$enum_member.__doc__";
} else {
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name = $enum_qualname.$enum_member\n";
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name.is_monkey_patched = True\n";
push @OUTPUT_PYTHON, "$enum_mk_base.$compat_name.__doc__ = \"$comment\"\n";
push @enum_members_doc, "'* ``$compat_name``: ' + $enum_qualname.$enum_member.__doc__";
}

0 comments on commit 759e3db

Please sign in to comment.